summaryrefslogtreecommitdiffstats
path: root/feature-pooling-dmaap/src/test/java/org
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-05-09 17:06:59 -0400
committerJim Hahn <jrh3@att.com>2018-05-09 17:06:59 -0400
commit49e77b6405ef7d286bdd667f2a689b20022351fc (patch)
treebbb18d8999f348046b0e49137d3f2a8ad4273e07 /feature-pooling-dmaap/src/test/java/org
parent9e77037eb13279a69a38dd78f400365f16e220c1 (diff)
Discard Forward to wrong host
Changed to discard Forward message if the channel does not match the host that received it. Change-Id: I9235bd3b0c5eb264f9b1cfe53552fadf66a0edc2 Issue-ID: POLICY-787 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-pooling-dmaap/src/test/java/org')
-rw-r--r--feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/IdleStateTest.java1
-rw-r--r--feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java6
-rw-r--r--feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StateTest.java5
3 files changed, 11 insertions, 1 deletions
diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/IdleStateTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/IdleStateTest.java
index 95cbe753..497dbbb7 100644
--- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/IdleStateTest.java
+++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/IdleStateTest.java
@@ -63,6 +63,7 @@ public class IdleStateTest extends BasicStateTester {
@Test
public void testProcessForward() {
Forward msg = new Forward();
+ msg.setChannel(MY_HOST);
assertNull(state.process(msg));
verify(mgr).handle(msg);
diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java
index ee4c1add..01f49b55 100644
--- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java
+++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StartStateTest.java
@@ -137,7 +137,11 @@ public class StartStateTest extends BasicStateTester {
@Test
public void testProcessForward() {
- assertNull(state.process(new Forward()));
+ Forward msg = new Forward();
+ msg.setChannel(MY_HOST);
+ assertNull(state.process(msg));
+
+ verify(mgr).handle(msg);
}
@Test
diff --git a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StateTest.java b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StateTest.java
index 47624aa0..cdf9b59a 100644
--- a/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StateTest.java
+++ b/feature-pooling-dmaap/src/test/java/org/onap/policy/drools/pooling/state/StateTest.java
@@ -212,6 +212,11 @@ public class StateTest extends BasicStateTester {
Forward msg = new Forward();
assertNull(state.process(msg));
+ verify(mgr, never()).handle(msg);
+
+ msg.setChannel(MY_HOST);
+ assertNull(state.process(msg));
+
verify(mgr).handle(msg);
}