diff options
author | bobbymander <bobby.mander@att.com> | 2019-11-15 13:59:18 -0500 |
---|---|---|
committer | bobbymander <bobby.mander@att.com> | 2019-11-15 13:59:30 -0500 |
commit | 0154925df97446afa15ab60d59c57237dfa7b2e9 (patch) | |
tree | cfdd6158de747a7a6b1089aba12d3b679474b397 /ONAP-PAP-REST/src/main | |
parent | b536883546b9fa87bce50c7a6d030f6de3aafdce (diff) |
More JUnit additions for PAP-REST
Issue-ID: POLICY-2130
Change-Id: Ia111e5fd6dfba1e03f157ff95f91ef65df293043
Signed-off-by: bobbymander <bobby.mander@att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/service/MetricService.java | 11 |
1 files changed, 5 insertions, 6 deletions
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; |