diff options
Diffstat (limited to 'controlloop/common/rules-test/src/test')
-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); |