diff options
Diffstat (limited to 'policy-management/src/test/java/org/onap')
-rw-r--r-- | policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java index 0b959f05..6b669a2d 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/system/internal/AggregatedPolicyControllerTest.java @@ -600,20 +600,17 @@ public class AggregatedPolicyControllerTest { @Test(expected = IllegalArgumentException.class) public void testDeliver_NullTopic() { - apc.start(); - apc.deliver(CommInfrastructure.NOOP, null, MY_EVENT); + validateDeliverFailure(null, MY_EVENT); } @Test(expected = IllegalArgumentException.class) public void testDeliver_EmptyTopic() { - apc.start(); - apc.deliver(CommInfrastructure.NOOP, "", MY_EVENT); + validateDeliverFailure("", MY_EVENT); } @Test(expected = IllegalArgumentException.class) public void testDeliver_NullEvent() { - apc.start(); - apc.deliver(CommInfrastructure.NOOP, SINK_TOPIC1, null); + validateDeliverFailure(SINK_TOPIC1, null); } @Test(expected = IllegalStateException.class) @@ -788,6 +785,11 @@ public class AggregatedPolicyControllerTest { assertTrue(apc.toString().startsWith("AggregatedPolicyController [")); } + private void validateDeliverFailure(String topic, String event) { + apc.start(); + apc.deliver(CommInfrastructure.NOOP, topic, event); + } + /** * Performs an operation that has a beforeXxx method and an afterXxx method. Tries * combinations where beforeXxx and afterXxx return {@code true} and {@code false}. |