diff options
author | Jorge Hernandez <jh1730@att.com> | 2018-09-28 02:58:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-09-28 02:58:51 +0000 |
commit | b2cbec29c685f6aef49a5828761045acee17224b (patch) | |
tree | a3710c561d4198a1ce6ae32b60e9f51692a416c6 /policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java | |
parent | 5305dfe6943760b5ac3248c8352d793e2e24adc3 (diff) | |
parent | a33a5992d070407c7172062235d219f4016c1073 (diff) |
Merge "Add coverage for policy-endpoints bus"
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java')
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java index d5e04d50..f45164f8 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicSourceFactory.java @@ -152,8 +152,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory { return dmaapTopicSources.get(busTopicParams.getTopic()); } - DmaapTopicSource dmaapTopicSource = - new SingleThreadedDmaapTopicSource(busTopicParams); + DmaapTopicSource dmaapTopicSource = makeSource(busTopicParams); if (busTopicParams.isManaged()) { dmaapTopicSources.put(busTopicParams.getTopic(), dmaapTopicSource); @@ -396,6 +395,16 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory { return this.build(servers, topic, null, null); } + /** + * Makes a new source. + * + * @param busTopicParams parameters to use to configure the source + * @return a new source + */ + protected DmaapTopicSource makeSource(BusTopicParams busTopicParams) { + return new SingleThreadedDmaapTopicSource(busTopicParams); + } + @Override public void destroy(String topic) { @@ -451,9 +460,7 @@ class IndexedDmaapTopicSourceFactory implements DmaapTopicSourceFactory { @Override public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("IndexedDmaapTopicSourceFactory []"); - return builder.toString(); + return "IndexedDmaapTopicSourceFactory []"; } } |