diff options
Diffstat (limited to 'fabric-discovery-plugin')
-rw-r--r-- | fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java | 23 |
1 files changed, 23 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 index f5dc7cbc0..ac0461889 100644 --- 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 @@ -17,6 +17,8 @@ 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 static final String W_STREAM = + "get://localhost:8185/data-change-event-subscription/network-topology:network/datastore=CONFIGURATION/scope=BASE"; private final String FB_DISCOVERY_STATUS = "fb-response"; @Test @@ -32,4 +34,25 @@ public class TestFabricDiscoveryPlugin { fdp.processDcNotificationStream(p, ctx); Assert.assertEquals("Success", ctx.getAttribute(FB_DISCOVERY_STATUS)); } + + @Test + public void connectToNotificationServerFailure() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + String stream = W_STREAM; + + Map<String, String> p = new HashMap<>(); + p.put("stream", stream); + p.put("enable", "true"); + + FabricDiscoveryPlugin fdp = new FabricDiscoveryPlugin(); + try { + fdp.processDcNotificationStream(p, ctx); + LOG.info("Connection to Stream:{} succeeded.", stream); + } catch (Exception e) { + LOG.info("Received Exception while connecting to Fabric Discovery notification server: {}", e.getMessage()); + } finally { + Assert.assertEquals("Failure", ctx.getAttribute(FB_DISCOVERY_STATUS)); + } + } + } |