From a956225992fa998fe4f89db07d16cb67c18cafcc Mon Sep 17 00:00:00 2001 From: uj426b Date: Thu, 16 Jul 2020 14:47:45 -0400 Subject: Support vDNS RainyDay test Case. Change-Id: I6d2b17c5379b19b04589da4d7bc4a7f6ebc4d23a Issue-ID: POLICY-2432 Signed-off-by: uj426b --- .../common/rules/test/BaseRuleTestTest.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'controlloop/common/rules-test/src/test') 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 @@ -333,6 +333,11 @@ public class BaseRuleTestTest { checkHttpPolicy(base::testVdnsSunnyDayCompliant); } + @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); -- cgit 1.2.3-korg