diff options
author | Peyton Puckett <peyton.puckett@att.com> | 2020-03-17 11:30:11 -0500 |
---|---|---|
committer | Peyton Puckett <peyton.puckett@att.com> | 2020-03-18 15:56:16 -0500 |
commit | ffb12d3ca702aa53c3f95d6e721f202f27e1aa8b (patch) | |
tree | 4f12a6a6b4c5fde837880b3273b3ecdf50b9fbb0 /controlloop/common/rules-test/src/test/java | |
parent | 01cbeec256bf5ec9e3ec2e7f599aef7eb4814ae3 (diff) |
Add rainyDayTest for VFW
Added less restrictive filter condition to consider discarded messages
Issue-ID: POLICY-2431
Change-Id: I0bc5e34636699094c97bd7e5669f66df875cd6ae
Signed-off-by: Peyton Puckett <peyton.puckett@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 | 53 |
1 files changed, 53 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 745013b3b..7274c6bda 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 @@ -316,6 +316,21 @@ public class BaseRuleTestTest { } @Test + public void testTestVfwRainyDayLegacyFailure() { + checkAppcLegacyPolicyOperationFailure("ModifyConfig", base::testVfwRainyDayLegacyFailure); + } + + @Test + public void testTestVfwRainyDayOverallTimeout() { + checkAppcLegacyPolicyFinalFailure("ModifyConfig", base::testVfwRainyDayOverallTimeout); + } + + @Test + public void testTestVfwRainyDayCompliantTimeout() { + checkAppcLegacyPolicyFinalFailure("ModifyConfig", base::testVfwRainyDayCompliantTimeout); + } + + @Test public void testTestVlbSunnyDayLegacy() { checkHttpPolicy(base::testVlbSunnyDayLegacy); } @@ -365,6 +380,44 @@ public class BaseRuleTestTest { verify(topics).inject(eq(BaseRuleTest.APPC_CL_TOPIC), any(), any()); } + protected void checkAppcLegacyPolicyOperationFailure(String operation, Runnable test) { + enqueueAppcLegacy(operation); + enqueueClMgt(ControlLoopNotificationType.OPERATION_FAILURE); + enqueueClMgt(ControlLoopNotificationType.FINAL_FAILURE); + + test.run(); + + assertEquals(1, permitCount); + assertEquals(1, finalCount); + + assertTrue(appcLcmQueue.isEmpty()); + assertTrue(clMgtQueue.isEmpty()); + + // initial event + verify(topics).inject(eq(BaseRuleTest.DCAE_TOPIC), any()); + + // reply to each APPC request + verify(topics).inject(eq(BaseRuleTest.APPC_CL_TOPIC), any(), any()); + } + + protected void checkAppcLegacyPolicyFinalFailure(String operation, Runnable test) { + enqueueAppcLegacy(operation); + enqueueClMgt(ControlLoopNotificationType.FINAL_FAILURE); + + test.run(); + + assertEquals(1, permitCount); + assertEquals(1, finalCount); + + assertTrue(appcLcmQueue.isEmpty()); + assertTrue(clMgtQueue.isEmpty()); + + // initial event + verify(topics).inject(eq(BaseRuleTest.DCAE_TOPIC), any()); + + // There were no requests sent + } + protected void checkHttpPolicy(Runnable test) { enqueueClMgt(ControlLoopNotificationType.OPERATION_SUCCESS); enqueueClMgt(ControlLoopNotificationType.FINAL_SUCCESS); |