summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-09-19 23:58:57 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-19 23:58:57 +0000
commit6f99a78bed3c382f956548641b5d45bb538d5e8c (patch)
tree19b3a78db4ec325459f670b5c16738dcaf1bf5f4
parent4947ee3c0a6685eeb99d7fc9f0a159d135252f28 (diff)
parentb75cf562ffd37a99eb171cb3ce03f90f1dd08d19 (diff)
Merge "Implement test case for Fabric Discovery Plugin"
-rw-r--r--fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java b/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java
new file mode 100644
index 000000000..f5dc7cbc0
--- /dev/null
+++ b/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java
@@ -0,0 +1,35 @@
+package jtest.org.onap.ccsdk.sli.plugins.fabricdiscovery;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.plugins.fabricdiscovery.FabricDiscoveryPlugin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Created by arun on 9/18/17.
+ */
+
+public class TestFabricDiscoveryPlugin {
+ private static final Logger LOG = LoggerFactory.getLogger(TestFabricDiscoveryPlugin.class);
+ private static final String C_STREAM =
+ "ws://localhost:8185/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE";
+ private final String FB_DISCOVERY_STATUS = "fb-response";
+
+ @Test
+ public void connectToNotificationServerSuccess() throws Exception {
+ SvcLogicContext ctx = new SvcLogicContext();
+ String stream = C_STREAM;
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("stream", stream);
+ p.put("enable", "true");
+
+ FabricDiscoveryPlugin fdp = new FabricDiscoveryPlugin();
+ fdp.processDcNotificationStream(p, ctx);
+ Assert.assertEquals("Success", ctx.getAttribute(FB_DISCOVERY_STATUS));
+ }
+}