X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fservice%2FMetricService.java;fp=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fservice%2FMetricService.java;h=36dd5fdee8bdd48a52b6099e98f7c954278d61b0;hp=594112636c54faa2b82e12e2c0c94268696954e4;hb=0154925df97446afa15ab60d59c57237dfa7b2e9;hpb=b536883546b9fa87bce50c7a6d030f6de3aafdce diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/MetricService.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/MetricService.java index 594112636..36dd5fdee 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/MetricService.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/MetricService.java @@ -21,13 +21,11 @@ package org.onap.policy.pap.xacml.rest.service; import com.att.research.xacml.api.pap.PDPPolicy; - +import com.google.common.annotations.VisibleForTesting; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.servlet.http.HttpServletResponse; - import org.json.JSONObject; import org.onap.policy.common.logging.eelf.MessageCodes; import org.onap.policy.common.logging.eelf.PolicyLogger; @@ -51,8 +49,9 @@ public class MetricService { } + @VisibleForTesting @Autowired - private MetricService(CommonClassDao commonClassDao) { + protected MetricService(CommonClassDao commonClassDao) { MetricService.commonClassDao = commonClassDao; } @@ -79,7 +78,7 @@ public class MetricService { json.put("totalCount", totalCount); if (pdpCount > 0 && papCount > 0 && totalCount > 0) { PolicyLogger.info( - "Metrics have been found on the Policy Engine for the number of policies on the PAP and PDP."); + "Metrics have been found on the Policy Engine for the number of policies on the PAP and PDP."); response.setStatus(HttpServletResponse.SC_OK); response.addHeader("successMapKey", "success"); response.addHeader("operation", "getMetrics"); @@ -87,7 +86,7 @@ public class MetricService { return; } else { String message = - "The policy count on the PAP and PDP is 0. Please check the database and file system to correct this error."; + "The policy count on the PAP and PDP is 0. Please check the database and file system to correct this error."; response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(errorMsg, message); return;