diff options
author | 2017-09-24 21:42:08 -0700 | |
---|---|---|
committer | 2017-09-24 21:42:08 -0700 | |
commit | a12faac8e7133f354050cf9b7990f8b35d022d01 (patch) | |
tree | 18280602041e405dfcd049443360a6674aa698f4 /fabric-discovery-plugin | |
parent | bb5be2989a75d48a56877e1bf5135a0bec68f43e (diff) |
Implement test cases for fabric discovery plugin
This change adds a negative test case to test input from
directed graph to specify whether to start or stop
listening to domain controller notifications.
Issue-id: CCSDK-96
Change-Id: I19e904c39e58e81d39079e233c68383496d8bc59
Signed-off-by: Arun S. Yerra <arun.yerra@huawei.com>
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 | 21 |
1 files changed, 21 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 ac046188..7a25e77b 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 @@ -55,4 +55,25 @@ public class TestFabricDiscoveryPlugin { } } + @Test + public void validateParameterEnableFailure() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + String stream = C_STREAM; + final String W_ENABLE_STR = "bad enable parameter"; + + Map<String, String> p = new HashMap<>(); + p.put("stream", stream); + p.put("enable", W_ENABLE_STR); + + 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)); + } + } + } |