diff options
author | Jim Hahn <jrh3@att.com> | 2019-10-31 17:58:45 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-10-31 17:58:45 -0400 |
commit | 3099737067f918599e83a6a7478a92bc208fe2ed (patch) | |
tree | 4311a630bb5c7adb345a3c30fa2d65d49d1d86cb /main/src | |
parent | 4f3fe21aa98a196ef1ddd62e1ac84a6c2e4c13cf (diff) |
Add tests for policy type in notifications
The junit tests verified that the policy specified in the notifications,
but did not verify the policy type. Added additional tests.
Issue-ID: POLICY-2190
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Iad2a06163f9dce3dff3753cddef98db9e9ad2eea
Diffstat (limited to 'main/src')
3 files changed, 10 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java index cfcf4471..3318684c 100644 --- a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java @@ -132,6 +132,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { tracker.removeData(makeData(policy2, PDP1, PDP3), statusList); assertEquals(1, statusList.size()); assertEquals(policy2, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertTrue(map.containsKey(policy1)); assertTrue(map.containsKey(policy2)); } @@ -149,6 +150,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { tracker.removeData(makeData(policy1, PDP1, PDP2, PDP3), statusList); assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertFalse(map.containsKey(policy1)); assertTrue(map.containsKey(policy2)); } @@ -165,6 +167,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals(3, map.size()); assertFalse(map.containsKey(policy1)); @@ -185,6 +188,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals(3, map.size()); assertFalse(map.containsKey(policy1)); @@ -205,6 +209,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals(3, map.size()); assertFalse(map.containsKey(policy1)); @@ -236,6 +241,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals(1, map.size()); assertTrue(map.containsKey(policy1)); @@ -258,6 +264,7 @@ public class PolicyCommonTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals("[2, 0, 0]", getCounts(statusList.get(0)).toString()); assertTrue(map.isEmpty()); diff --git a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyDeployTrackerTest.java b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyDeployTrackerTest.java index bd093141..832fddc9 100644 --- a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyDeployTrackerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyDeployTrackerTest.java @@ -71,6 +71,7 @@ public class PolicyDeployTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals("[2, 0, 0]", getCounts(statusList.get(0)).toString()); // indicate that PDP1 has failed - should get a notification, if still in the map @@ -78,6 +79,7 @@ public class PolicyDeployTrackerTest extends PolicyCommonSupport { tracker.processResponse(PDP1, Collections.emptyList(), statusList); assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals("[1, 1, 0]", getCounts(statusList.get(0)).toString()); } diff --git a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyUndeployTrackerTest.java b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyUndeployTrackerTest.java index d837cbad..ba85c489 100644 --- a/main/src/test/java/org/onap/policy/pap/main/notification/PolicyUndeployTrackerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/notification/PolicyUndeployTrackerTest.java @@ -71,6 +71,7 @@ public class PolicyUndeployTrackerTest extends PolicyCommonSupport { assertEquals(1, statusList.size()); assertEquals(policy1, statusList.get(0).getPolicy()); + assertEquals(type, statusList.get(0).getPolicyType()); assertEquals("[2, 0, 0]", getCounts(statusList.get(0)).toString()); // indicate that PDP1 has been re-deployed - should not get a notification, |