aboutsummaryrefslogtreecommitdiffstats
path: root/dmaap-listener/src/test/java
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-10-03 07:34:22 -0400
committerDan Timoney <dtimoney@att.com>2017-10-03 07:34:22 -0400
commit12d893efa353bc5bd5054cd59998a623f5d058d0 (patch)
tree44baab68c60f9dcd7e093880f60c69b2a54b972d /dmaap-listener/src/test/java
parent119808a2ded9ea8c4dd9d1eef96f39ab2e001ff7 (diff)
Add unit test for dmaap-listener
Add unit test case for dmaap-listener. Change-Id: I501614016c96d8300bc15cdf1819691f95c467f4 Issue-ID: CCSDK-106 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'dmaap-listener/src/test/java')
-rw-r--r--dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java
new file mode 100644
index 00000000..943ef020
--- /dev/null
+++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/TestDmaapListener.java
@@ -0,0 +1,52 @@
+package org.onap.ccsdk.sli.northbound.dmaapclient;
+
+import static org.junit.Assert.*;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TestDmaapListener {
+
+ private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties";
+ private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources";
+
+ private static final Logger LOG = LoggerFactory.getLogger(TestDmaapListener.class);
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @Test
+ public void test() {
+ Properties properties = new Properties();
+ String propFileName = DMAAP_LISTENER_PROPERTIES;
+ String propPath = null;
+ String propDir = DMAAP_LISTENER_PROPERTIES_DIR;
+
+ List<SdncDmaapConsumer> consumers = new LinkedList<>();
+
+
+ propPath = propDir + "/" + propFileName;
+
+ if (propPath != null) {
+ properties = DmaapListener.loadProperties(propPath, properties);
+
+ String subscriptionStr = properties.getProperty("subscriptions");
+
+ boolean threadsRunning = false;
+
+ LOG.debug("Dmaap subscriptions : " + subscriptionStr);
+
+ if (subscriptionStr != null) {
+ threadsRunning = DmaapListener.handleSubscriptions(subscriptionStr, propDir, properties, consumers);
+ }
+ }
+ }
+
+}