aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java101
1 files changed, 13 insertions, 88 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 e47b2665..92dd6483 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
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,8 +35,6 @@ import java.util.Properties;
import org.junit.After;
import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.bus.DmaapTopicFactories;
-import org.onap.policy.common.endpoints.event.comm.bus.DmaapTopicPropertyBuilder;
import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories;
import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicPropertyBuilder;
import org.onap.policy.common.endpoints.event.comm.bus.UebTopicFactories;
@@ -53,9 +52,6 @@ public class TopicEndpointProxyTest {
private static final String UEB_SOURCE_TOPIC = "ueb-source";
private static final String UEB_SINK_TOPIC = "ueb-sink";
- private static final String DMAAP_SOURCE_TOPIC = "dmaap-source";
- private static final String DMAAP_SINK_TOPIC = "dmaap-sink";
-
private Properties configuration = new Properties();
private TopicParameterGroup group = new TopicParameterGroup();
@@ -90,18 +86,6 @@ public class TopicEndpointProxyTest {
configuration.putAll(uebSinkBuilder.build());
group.getTopicSinks().add(uebSinkBuilder.getParams());
- DmaapTopicPropertyBuilder dmaapSourceBuilder =
- new DmaapTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_DMAAP_SOURCE_TOPICS)
- .makeTopic(DMAAP_SOURCE_TOPIC);
- configuration.putAll(dmaapSourceBuilder.build());
- group.getTopicSources().add(dmaapSourceBuilder.getParams());
-
- DmaapTopicPropertyBuilder dmaapSinkBuilder =
- new DmaapTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS)
- .makeTopic(DMAAP_SINK_TOPIC);
- configuration.putAll(dmaapSinkBuilder.build());
- group.getTopicSinks().add(dmaapSinkBuilder.getParams());
-
TopicParameters invalidCommInfraParams =
new NoopTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_NOOP_SOURCE_TOPICS)
.makeTopic(NOOP_SOURCE_TOPIC).getParams();
@@ -115,21 +99,19 @@ public class TopicEndpointProxyTest {
}
private <T extends Topic> boolean allSources(List<T> topics) {
- return exists(topics, NOOP_SOURCE_TOPIC) && exists(topics, UEB_SOURCE_TOPIC)
- && exists(topics, DMAAP_SOURCE_TOPIC);
+ return exists(topics, NOOP_SOURCE_TOPIC) && exists(topics, UEB_SOURCE_TOPIC);
}
private <T extends Topic> boolean allSinks(List<T> topics) {
- return exists(topics, NOOP_SINK_TOPIC) && exists(topics, UEB_SINK_TOPIC) && exists(topics, DMAAP_SINK_TOPIC);
+ return exists(topics, NOOP_SINK_TOPIC) && exists(topics, UEB_SINK_TOPIC);
}
private <T extends Topic> boolean anySource(List<T> topics) {
- return exists(topics, NOOP_SOURCE_TOPIC) || exists(topics, UEB_SOURCE_TOPIC)
- || exists(topics, DMAAP_SOURCE_TOPIC);
+ return exists(topics, NOOP_SOURCE_TOPIC) || exists(topics, UEB_SOURCE_TOPIC);
}
private <T extends Topic> boolean anySink(List<T> topics) {
- return exists(topics, NOOP_SINK_TOPIC) || exists(topics, UEB_SINK_TOPIC) || exists(topics, DMAAP_SINK_TOPIC);
+ return exists(topics, NOOP_SINK_TOPIC) || exists(topics, UEB_SINK_TOPIC);
}
/**
@@ -142,9 +124,6 @@ public class TopicEndpointProxyTest {
UebTopicFactories.getSinkFactory().destroy();
UebTopicFactories.getSourceFactory().destroy();
-
- DmaapTopicFactories.getSinkFactory().destroy();
- DmaapTopicFactories.getSourceFactory().destroy();
}
@Test
@@ -163,7 +142,7 @@ public class TopicEndpointProxyTest {
TopicEndpoint manager = new TopicEndpointProxy();
List<TopicSource> sources = manager.addTopicSources(group.getTopicSources());
- assertSame(3, sources.size());
+ assertSame(2, sources.size());
assertTrue(allSources(sources));
assertFalse(anySink(sources));
@@ -174,7 +153,7 @@ public class TopicEndpointProxyTest {
TopicEndpoint manager = new TopicEndpointProxy();
List<TopicSource> sources = manager.addTopicSources(configuration);
- assertSame(3, sources.size());
+ assertSame(2, sources.size());
assertTrue(allSources(sources));
assertFalse(anySink(sources));
@@ -185,7 +164,7 @@ public class TopicEndpointProxyTest {
TopicEndpoint manager = new TopicEndpointProxy();
List<TopicSink> sinks = manager.addTopicSinks(group.getTopicSinks());
- assertSame(3, sinks.size());
+ assertSame(2, sinks.size());
assertFalse(anySource(sinks));
assertTrue(allSinks(sinks));
@@ -196,7 +175,7 @@ public class TopicEndpointProxyTest {
TopicEndpoint manager = new TopicEndpointProxy();
List<TopicSink> sinks = manager.addTopicSinks(configuration);
- assertSame(3, sinks.size());
+ assertSame(2, sinks.size());
assertFalse(anySource(sinks));
assertTrue(allSinks(sinks));
@@ -207,7 +186,7 @@ public class TopicEndpointProxyTest {
TopicEndpoint manager = new TopicEndpointProxy();
List<Topic> topics = manager.addTopics(configuration);
- assertSame(6, topics.size());
+ assertSame(4, topics.size());
assertTrue(allSources(topics));
assertTrue(allSinks(topics));
@@ -218,7 +197,7 @@ public class TopicEndpointProxyTest {
TopicEndpoint manager = new TopicEndpointProxy();
List<Topic> topics = manager.addTopics(group);
- assertSame(6, topics.size());
+ assertSame(4, topics.size());
assertTrue(allSources(topics));
assertTrue(allSinks(topics));
@@ -257,7 +236,7 @@ public class TopicEndpointProxyTest {
manager.addTopicSinks(configuration);
List<TopicSource> sources = manager.getTopicSources();
- assertSame(3, sources.size());
+ assertSame(2, sources.size());
assertTrue(allSources(sources));
assertFalse(anySink(sources));
@@ -271,7 +250,7 @@ public class TopicEndpointProxyTest {
manager.addTopicSinks(configuration);
List<TopicSink> sinks = manager.getTopicSinks();
- assertSame(3, sinks.size());
+ assertSame(2, sinks.size());
assertFalse(anySource(sinks));
assertTrue(allSinks(sinks));
@@ -286,14 +265,6 @@ public class TopicEndpointProxyTest {
}
@Test
- public void testGetDmaapTopicSources() {
- TopicEndpoint manager = new TopicEndpointProxy();
-
- manager.addTopicSources(configuration);
- assertSame(1, manager.getDmaapTopicSources().size());
- }
-
- @Test
public void testGetNoopTopicSources() {
TopicEndpoint manager = new TopicEndpointProxy();
@@ -310,14 +281,6 @@ public class TopicEndpointProxyTest {
}
@Test
- public void testGetDmaapTopicSinks() {
- TopicEndpoint manager = new TopicEndpointProxy();
-
- manager.addTopicSinks(configuration);
- assertSame(1, manager.getDmaapTopicSinks().size());
- }
-
- @Test
public void testGetNoopTopicSinks() {
TopicEndpoint manager = new TopicEndpointProxy();
@@ -360,14 +323,11 @@ public class TopicEndpointProxyTest {
assertSame(NOOP_SOURCE_TOPIC, manager.getTopicSource(CommInfrastructure.NOOP, NOOP_SOURCE_TOPIC).getTopic());
assertSame(UEB_SOURCE_TOPIC, manager.getTopicSource(CommInfrastructure.UEB, UEB_SOURCE_TOPIC).getTopic());
- assertSame(DMAAP_SOURCE_TOPIC, manager.getTopicSource(CommInfrastructure.DMAAP, DMAAP_SOURCE_TOPIC).getTopic());
assertThatIllegalStateException()
.isThrownBy(() -> manager.getTopicSource(CommInfrastructure.NOOP, NOOP_SINK_TOPIC));
assertThatIllegalStateException()
.isThrownBy(() -> manager.getTopicSource(CommInfrastructure.UEB, UEB_SINK_TOPIC));
- assertThatIllegalStateException()
- .isThrownBy(() -> manager.getTopicSource(CommInfrastructure.DMAAP, DMAAP_SINK_TOPIC));
}
@Test
@@ -377,14 +337,11 @@ public class TopicEndpointProxyTest {
assertSame(NOOP_SINK_TOPIC, manager.getTopicSink(CommInfrastructure.NOOP, NOOP_SINK_TOPIC).getTopic());
assertSame(UEB_SINK_TOPIC, manager.getTopicSink(CommInfrastructure.UEB, UEB_SINK_TOPIC).getTopic());
- assertSame(DMAAP_SINK_TOPIC, manager.getTopicSink(CommInfrastructure.DMAAP, DMAAP_SINK_TOPIC).getTopic());
assertThatIllegalStateException()
.isThrownBy(() -> manager.getTopicSink(CommInfrastructure.NOOP, NOOP_SOURCE_TOPIC));
assertThatIllegalStateException()
.isThrownBy(() -> manager.getTopicSink(CommInfrastructure.UEB, UEB_SOURCE_TOPIC));
- assertThatIllegalStateException()
- .isThrownBy(() -> manager.getTopicSink(CommInfrastructure.DMAAP, DMAAP_SOURCE_TOPIC));
}
@Test
@@ -395,7 +352,6 @@ public class TopicEndpointProxyTest {
assertSame(UEB_SOURCE_TOPIC, manager.getUebTopicSource(UEB_SOURCE_TOPIC).getTopic());
assertThatIllegalStateException().isThrownBy(() -> manager.getUebTopicSource(NOOP_SOURCE_TOPIC));
- assertThatIllegalStateException().isThrownBy(() -> manager.getUebTopicSource(DMAAP_SOURCE_TOPIC));
assertThatIllegalArgumentException().isThrownBy(() -> manager.getUebTopicSource(null));
assertThatIllegalArgumentException().isThrownBy(() -> manager.getUebTopicSource(""));
@@ -409,48 +365,18 @@ public class TopicEndpointProxyTest {
assertSame(UEB_SINK_TOPIC, manager.getUebTopicSink(UEB_SINK_TOPIC).getTopic());
assertThatIllegalStateException().isThrownBy(() -> manager.getUebTopicSink(NOOP_SINK_TOPIC));
- assertThatIllegalStateException().isThrownBy(() -> manager.getUebTopicSink(DMAAP_SINK_TOPIC));
assertThatIllegalArgumentException().isThrownBy(() -> manager.getUebTopicSink(null));
assertThatIllegalArgumentException().isThrownBy(() -> manager.getUebTopicSink(""));
}
@Test
- public void testGetDmaapTopicSource() {
- TopicEndpoint manager = new TopicEndpointProxy();
- manager.addTopicSources(configuration);
-
- assertSame(DMAAP_SOURCE_TOPIC, manager.getDmaapTopicSource(DMAAP_SOURCE_TOPIC).getTopic());
-
- assertThatIllegalStateException().isThrownBy(() -> manager.getDmaapTopicSource(NOOP_SOURCE_TOPIC));
- assertThatIllegalStateException().isThrownBy(() -> manager.getDmaapTopicSource(UEB_SOURCE_TOPIC));
-
- assertThatIllegalArgumentException().isThrownBy(() -> manager.getDmaapTopicSource(null));
- assertThatIllegalArgumentException().isThrownBy(() -> manager.getDmaapTopicSource(""));
- }
-
- @Test
- public void testGetDmaapTopicSink() {
- TopicEndpoint manager = new TopicEndpointProxy();
- manager.addTopicSinks(configuration);
-
- assertSame(DMAAP_SINK_TOPIC, manager.getDmaapTopicSink(DMAAP_SINK_TOPIC).getTopic());
-
- assertThatIllegalStateException().isThrownBy(() -> manager.getDmaapTopicSink(NOOP_SINK_TOPIC));
- assertThatIllegalStateException().isThrownBy(() -> manager.getDmaapTopicSink(UEB_SINK_TOPIC));
-
- assertThatIllegalArgumentException().isThrownBy(() -> manager.getDmaapTopicSink(null));
- assertThatIllegalArgumentException().isThrownBy(() -> manager.getDmaapTopicSink(""));
- }
-
- @Test
public void testGetNoopTopicSource() {
TopicEndpoint manager = new TopicEndpointProxy();
manager.addTopicSources(configuration);
assertSame(NOOP_SOURCE_TOPIC, manager.getNoopTopicSource(NOOP_SOURCE_TOPIC).getTopic());
- assertThatIllegalStateException().isThrownBy(() -> manager.getNoopTopicSource(DMAAP_SOURCE_TOPIC));
assertThatIllegalStateException().isThrownBy(() -> manager.getNoopTopicSource(UEB_SOURCE_TOPIC));
assertThatIllegalArgumentException().isThrownBy(() -> manager.getNoopTopicSource(null));
@@ -464,7 +390,6 @@ public class TopicEndpointProxyTest {
assertSame(NOOP_SINK_TOPIC, manager.getNoopTopicSink(NOOP_SINK_TOPIC).getTopic());
- assertThatIllegalStateException().isThrownBy(() -> manager.getNoopTopicSink(DMAAP_SINK_TOPIC));
assertThatIllegalStateException().isThrownBy(() -> manager.getNoopTopicSink(UEB_SINK_TOPIC));
assertThatIllegalArgumentException().isThrownBy(() -> manager.getNoopTopicSink(null));