*/
TopicEndpoint manager = new TopicEndpointProxy();
+ /**
+ * Add topics configuration (sources and sinks) into a single list.
+ *
+ * @param properties topic configuration
+ * @return topic list
+ * @throws IllegalArgumentException when invalid arguments are provided
+ */
+ List<Topic> addTopics(Properties properties);
+
/**
* Add Topic Sources to the communication infrastructure initialized per properties.
*
*/
private volatile boolean alive = false;
+ @Override
+ public List<Topic> addTopics(Properties properties) {
+ List<Topic> topics = new ArrayList<>(addTopicSources(properties));
+ topics.addAll(addTopicSinks(properties));
+ return topics;
+ }
+
@Override
public List<TopicSource> addTopicSources(Properties properties) {
assertTrue(allSinks(sinks));
}
+ @Test
+ public void addTopics() {
+ TopicEndpoint manager = new TopicEndpointProxy();
+
+ List<Topic> topics = manager.addTopics(configuration);
+ assertSame(6, topics.size());
+
+ assertTrue(allSources(topics));
+ assertTrue(allSinks(topics));
+ }
+
@Test
public void getTopicSources() {
TopicEndpoint manager = new TopicEndpointProxy();