summaryrefslogtreecommitdiffstats
path: root/controlloop/common/rules-test/src/test/java
diff options
context:
space:
mode:
authoruj426b <uj426b@att.com>2020-07-16 14:47:45 -0400
committerUtkarsh Jauhari <uj426b@att.com>2020-07-20 13:46:49 +0000
commita956225992fa998fe4f89db07d16cb67c18cafcc (patch)
tree779333b5dc29dc576e04125c550ad5ae04800528 /controlloop/common/rules-test/src/test/java
parent24297a111b10247058150f2947fea13d72d36b5c (diff)
Support vDNS RainyDay test Case.
Change-Id: I6d2b17c5379b19b04589da4d7bc4a7f6ebc4d23a Issue-ID: POLICY-2432 Signed-off-by: uj426b <uj426b@att.com>
Diffstat (limited to 'controlloop/common/rules-test/src/test/java')
-rw-r--r--controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java
index cfa9c49eb..9f313ca39 100644
--- a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java
+++ b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java
@@ -334,6 +334,11 @@ public class BaseRuleTestTest {
}
@Test
+ public void testTestVdnsRainyDayCompliant() {
+ checkHttpPolicyCompliantFailure(base::testVdnsRainyDayCompliant);
+ }
+
+ @Test
public void testTestVfwSunnyDayLegacy() {
checkAppcLegacyPolicy("ModifyConfig", base::testVfwSunnyDayLegacy);
}
@@ -491,6 +496,21 @@ public class BaseRuleTestTest {
verify(topics).inject(eq(BaseRuleTest.DCAE_TOPIC), any());
}
+ protected void checkHttpPolicyCompliantFailure(Runnable test) {
+ enqueueClMgt(ControlLoopNotificationType.OPERATION_FAILURE);
+ enqueueClMgt(ControlLoopNotificationType.FINAL_FAILURE);
+
+ test.run();
+
+ assertEquals(1, permitCount);
+ assertEquals(1, finalCount);
+
+ assertTrue(clMgtQueue.isEmpty());
+
+ // initial event
+ verify(topics).inject(eq(BaseRuleTest.DCAE_TOPIC), any());
+ }
+
private void enqueueClMgt(ControlLoopNotificationType type) {
VirtualControlLoopNotification notif = new VirtualControlLoopNotification();
notif.setNotification(type);