diff options
Diffstat (limited to 'main/src/test/java')
-rw-r--r-- | main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java | 7 | ||||
-rw-r--r-- | main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java index ba8f0044..7865851d 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java @@ -44,6 +44,8 @@ public class TestXacmlPdpRestServer extends CommonRest { private static final String HEALTHCHECK_ENDPOINT = "healthcheck"; private static final String STATISTICS_ENDPOINT = "statistics"; + private int nupdates = 0; + @Test public void testHealthCheckSuccess() throws Exception { LOGGER.info("***************************** Running testHealthCheckSuccess *****************************"); @@ -111,7 +113,9 @@ public class TestXacmlPdpRestServer extends CommonRest { private void updateXacmlPdpStatistics() { XacmlPdpStatisticsManager stats = XacmlPdpStatisticsManager.getCurrent(); - stats.updateTotalPoliciesCount(); + ++nupdates; + stats.setTotalPolicyCount(nupdates); + stats.setTotalPolicyTypesCount(nupdates); stats.updatePermitDecisionsCount(); stats.updateDenyDecisionsCount(); stats.updateIndeterminantDecisionsCount(); @@ -121,6 +125,7 @@ public class TestXacmlPdpRestServer extends CommonRest { private void validateStatisticsReport(final StatisticsReport report, final int count, final int code) { assertEquals(code, report.getCode()); assertEquals(count, report.getTotalPoliciesCount()); + assertEquals(count, report.getTotalPolicyTypesCount()); assertEquals(count, report.getPermitDecisionsCount()); assertEquals(count, report.getDenyDecisionsCount()); assertEquals(count, report.getIndeterminantDecisionsCount()); diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java index 250f21e6..030b9075 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpStatistics.java @@ -37,6 +37,8 @@ public class TestXacmlPdpStatistics extends CommonRest { private static final Logger LOGGER = LoggerFactory.getLogger(TestXacmlPdpStatistics.class); + private int nupdates = 0; + @Test public void testXacmlPdpStatistics_200() throws Exception { LOGGER.info("*************************** Running testXacmlPdpStatistics_200 ***************************"); @@ -64,7 +66,9 @@ public class TestXacmlPdpStatistics extends CommonRest { private void updateXacmlPdpStatistics() { XacmlPdpStatisticsManager stats = XacmlPdpStatisticsManager.getCurrent(); - stats.updateTotalPoliciesCount(); + ++nupdates; + stats.setTotalPolicyCount(nupdates); + stats.setTotalPolicyTypesCount(nupdates); stats.updatePermitDecisionsCount(); stats.updateDenyDecisionsCount(); stats.updateIndeterminantDecisionsCount(); @@ -74,6 +78,7 @@ public class TestXacmlPdpStatistics extends CommonRest { private void validateReport(final StatisticsReport report, final int count, final int code) { assertEquals(code, report.getCode()); assertEquals(count, report.getTotalPoliciesCount()); + assertEquals(count, report.getTotalPolicyTypesCount()); assertEquals(count, report.getPermitDecisionsCount()); assertEquals(count, report.getDenyDecisionsCount()); assertEquals(count, report.getIndeterminantDecisionsCount()); |