summaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-30 09:53:19 -0400
committerJim Hahn <jrh3@att.com>2019-07-30 11:39:55 -0400
commit63d5702986d5dc63eb3d0ed2e3b57ce3b529966f (patch)
tree000bb7004a70e1187b78e39dc0941d57d4de4e43 /policy-endpoints/src/test/java/org
parent32a6ceac730a392f18a15ca562b0545edbd8fec8 (diff)
Fix managed noop topic source
NOOP topic sources configured via TopicParameterGroup are left unmanaged. Removed a new override method, as it did not pass the "managed" flag down, while the method that already existed in the superclass already works correctly. Also restored "null" lists to TopicParameterGroup so-as not to break the behavior of its validate() method. Change-Id: Id392a3263c3bd1c8f278461715b441719817c47c Issue-ID: POLICY-1953 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java
index 22ddecd1..fa432265 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java
@@ -22,10 +22,12 @@ package org.onap.policy.common.endpoints.event.comm;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
+import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import org.junit.After;
@@ -60,6 +62,9 @@ public class TopicEndpointProxyTest {
* Constructor.
*/
public TopicEndpointProxyTest() {
+ group.setTopicSinks(new LinkedList<>());
+ group.setTopicSources(new LinkedList<>());
+
NoopTopicPropertyBuilder noopSourceBuilder =
new NoopTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_NOOP_SOURCE_TOPICS)
.makeTopic(NOOP_SOURCE_TOPIC);
@@ -224,6 +229,14 @@ public class TopicEndpointProxyTest {
}
@Test
+ public void addTopicsTopicParameterGroupNull() {
+ TopicEndpoint manager = new TopicEndpointProxy();
+
+ List<Topic> topics = manager.addTopics(new TopicParameterGroup());
+ assertEquals(0, topics.size());
+ }
+
+ @Test
public void lockSinks_lockSources_locked() {
TopicEndpoint manager = new TopicEndpointProxy();
manager.lock();