diff options
author | uj426b <uj426b@att.com> | 2020-07-16 14:47:45 -0400 |
---|---|---|
committer | Utkarsh Jauhari <uj426b@att.com> | 2020-07-20 13:46:49 +0000 |
commit | a956225992fa998fe4f89db07d16cb67c18cafcc (patch) | |
tree | 779333b5dc29dc576e04125c550ad5ae04800528 /controlloop/common/rules-test/src/test/java | |
parent | 24297a111b10247058150f2947fea13d72d36b5c (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.java | 20 |
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); |