aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java
diff options
context:
space:
mode:
authorisaac <isaac.adorno@att.com>2022-01-04 16:34:20 -0600
committerIsaac Adorno <isaac.adorno@att.com>2022-01-07 14:51:17 +0000
commit9de4055ab950735268e037a1e9cc41d998df7252 (patch)
treef344fecf4be1f806145dc465e50747ab98e6a8b6 /main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java
parent4694c152f69380f4d3d64bde0a13d15fb59a71f3 (diff)
Adding totalPolicyDeployCounts updates to PapStasticsManager
Issue-ID: POLICY-3836 Signed-off-by: isaac <isaac.adorno@att.com> Change-Id: Ia4ed2595984f68bf75ca9dacb6aa76f04a306224
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java
index 40e37e4f..28e515f3 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployProvider.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP PAP
* ================================================================================
- * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Nordix Foundation.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
@@ -54,6 +54,7 @@ import org.onap.policy.models.pdp.concepts.PdpSubGroup;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
+import org.onap.policy.pap.main.PapConstants;
public class TestPdpGroupDeployProvider extends ProviderSuper {
@@ -575,6 +576,25 @@ public class TestPdpGroupDeployProvider extends ProviderSuper {
.hasMessage("policy not supported by any PDP group: policyA 1.2.3");
}
+ /**
+ * Tests PapStatisticsManager counts when policies are added to a subgroup.
+ *
+ * @throws Exception if an error occurs
+ */
+ @Test
+ public void testDeployedPdpGroupCountStatistics() throws Exception {
+ Registry.unregister(PapConstants.REG_STATISTICS_MANAGER);
+ PapStatisticsManager mgr = new PapStatisticsManager();
+ Registry.register(PapConstants.REG_STATISTICS_MANAGER, mgr);
+
+ when(dao.getFilteredPdpGroups(any())).thenReturn(loadGroups("deployPoliciesWildCard.json"));
+ prov.deployPolicies(loadRequest("multiple_requests.json"), DEFAULT_USER);
+ assertEquals(mgr.getTotalPolicyDeployCount(), 3);
+
+ Registry.unregister(PapConstants.REG_STATISTICS_MANAGER);
+ Registry.register(PapConstants.REG_STATISTICS_MANAGER, statsmanager);
+ }
+
@Test
public void testMakeUpdater() throws Exception {
/*