summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-11-01 13:21:41 +0000
committerGerrit Code Review <gerrit@onap.org>2019-11-01 13:21:41 +0000
commit85a229538caa5c066266520683a9455d970f390f (patch)
tree8a72f4f31c1aa24472556e9a38ff8f6af829fac4
parent6fbb0957345012d53f1bf9d27e6bcf64e13711a1 (diff)
parent3099737067f918599e83a6a7478a92bc208fe2ed (diff)
Merge "Add tests for policy type in notifications"
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/notification/PolicyCommonTrackerTest.java7
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/notification/PolicyDeployTrackerTest.java2
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/notification/PolicyUndeployTrackerTest.java1
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,