aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-09-28 09:53:14 -0400
committerJim Hahn <jrh3@att.com>2018-09-28 16:52:08 -0400
commit53f06d93dc2c4d292ea1c7dad24df0d72cc01dc5 (patch)
treedf98f63e1410b3eb0224cbb79fe4d45f754f9a9b /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java
parentb2cbec29c685f6aef49a5828761045acee17224b (diff)
Add junit coverage to rest of policy-endpoint bus
Also extracted out common code from tests. Fix checkstyle issues. Be consistent in returning IllegalStateException when topic is not found by any Topic Factory. Added/updated some comments. Use better name for "validate" argument. Renamed test() to testDestroy(). Added NoopTopicPropertyBuilder. Renamed BusTopicTestBase to TopicTestBase. Change-Id: Id4c7ab9f2b5572dc5195b0da116e285c5e9b6f06 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java
index 8ca22ebe..7276b445 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/DmaapTopicPropertyBuilder.java
@@ -20,17 +20,19 @@
package org.onap.policy.common.endpoints.event.comm.bus;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_AFT_ENV;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_API_KEY;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_API_SECRET;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_ENV;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_FETCH_LIMIT;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_FETCH_TIMEOUT;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_LAT;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_LONG;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_PARTITION;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_PARTNER;
-import static org.onap.policy.common.endpoints.event.comm.bus.BusTopicTestBase.MY_ROUTE;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_AFT_ENV;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_API_KEY;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_API_SECRET;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_CONS_GROUP;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_CONS_INST;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_ENV;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_FETCH_LIMIT;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_FETCH_TIMEOUT;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_LAT;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_LONG;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_PARTITION;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_PARTNER;
+import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_ROUTE;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_DMAAP_DME2_AFT_ENVIRONMENT_SUFFIX;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_DMAAP_DME2_ENVIRONMENT_SUFFIX;
@@ -52,6 +54,8 @@ import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperti
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_API_SECRET_SUFFIX;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX;
+import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX;
+import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX;
import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX;
@@ -87,6 +91,8 @@ public class DmaapTopicPropertyBuilder extends TopicPropertyBuilder {
public DmaapTopicPropertyBuilder makeTopic(String topic) {
addTopic(topic);
+ setTopicProperty(PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX, MY_CONS_GROUP);
+ setTopicProperty(PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX, MY_CONS_INST);
setTopicProperty(PROPERTY_MANAGED_SUFFIX, "true");
setTopicProperty(PROPERTY_HTTP_HTTPS_SUFFIX, "true");
setTopicProperty(PROPERTY_TOPIC_AAF_MECHID_SUFFIX, MY_AAF_MECHID);