f5dc7cbc0f16a1fc35d2715dc6ca22562d093b2a
[ccsdk/sli/plugins.git] / fabric-discovery-plugin / provider / src / test / java / jtest / org / onap / ccsdk / sli / plugins / fabricdiscovery / TestFabricDiscoveryPlugin.java
1 package jtest.org.onap.ccsdk.sli.plugins.fabricdiscovery;
2
3 import java.util.HashMap;
4 import java.util.Map;
5 import org.junit.Assert;
6 import org.junit.Test;
7 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
8 import org.onap.ccsdk.sli.plugins.fabricdiscovery.FabricDiscoveryPlugin;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11
12 /**
13  * Created by arun on 9/18/17.
14  */
15
16 public class TestFabricDiscoveryPlugin {
17     private static final Logger LOG = LoggerFactory.getLogger(TestFabricDiscoveryPlugin.class);
18     private static final String C_STREAM =
19         "ws://localhost:8185/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE";
20     private final String FB_DISCOVERY_STATUS = "fb-response";
21
22     @Test
23     public void connectToNotificationServerSuccess() throws Exception {
24         SvcLogicContext ctx = new SvcLogicContext();
25         String stream = C_STREAM;
26
27         Map<String, String> p = new HashMap<String, String>();
28         p.put("stream", stream);
29         p.put("enable", "true");
30
31         FabricDiscoveryPlugin fdp = new FabricDiscoveryPlugin();
32         fdp.processDcNotificationStream(p, ctx);
33         Assert.assertEquals("Success", ctx.getAttribute(FB_DISCOVERY_STATUS));
34     }
35 }