summaryrefslogtreecommitdiffstats
path: root/restconf-client/provider/src/test/java
diff options
context:
space:
mode:
authorjanani b <janani.b@huawei.com>2018-09-27 15:26:39 +0530
committerjanani b <janani.b@huawei.com>2018-09-27 15:26:39 +0530
commitc8e5aa9f493ec5f80e4444285816ceed27b1752b (patch)
treec904c128afb6ab5edd0356511a12c10b25447117 /restconf-client/provider/src/test/java
parent85737499b931441be3013831d7ce76a5c4734032 (diff)
Issue fixes for Restconf discovery node
i) Adding constructor param ii) execute dg param order fix iii) Constants value fix. Issue-ID: CCSDK-325 Change-Id: I5aaf4b66b3982e4a1d3736362be3a5e8d7ab6d00 Signed-off-by: janani b <janani.b@huawei.com>
Diffstat (limited to 'restconf-client/provider/src/test/java')
-rw-r--r--restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java31
1 files changed, 20 insertions, 11 deletions
diff --git a/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java b/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java
index db878f0af..b2094ca73 100644
--- a/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java
+++ b/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java
@@ -20,16 +20,19 @@
package org.onap.ccsdk.sli.plugins.restconfdiscovery;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.media.sse.SseFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.Test;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode;
+import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode;
+
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
@@ -47,13 +50,15 @@ public class TestRestconfDiscoveryNode {
ctx.setAttribute("prop.encoding-json", "encoding-json");
ctx.setAttribute("restapi-result.response-code", "200");
ctx.setAttribute("restapi-result.ietf-subscribed-notifications" +
- ":output.identifier", "100");
+ ":establish-subscription.output.identifier",
+ "100");
Map<String, String> p = new HashMap<>();
p.put("sseConnectURL", "http://localhost:8080/events");
p.put("subscriberId", "networkId");
p.put("responsePrefix", "restapi-result");
- RestconfDiscoveryNode rdn = new RestconfDiscoveryNode();
+ RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
+ new RestconfApiCallNode(new RestapiCallNode()));
rdn.establishPersistentConnection(p, ctx, "networkId");
Thread.sleep(2000);
rdn.deleteSubscription(p, ctx);
@@ -75,7 +80,8 @@ public class TestRestconfDiscoveryNode {
throws SvcLogicException{
SvcLogicContext ctx = new SvcLogicContext();
Map<String, String> p = new HashMap<>();
- RestconfDiscoveryNode rdn = new RestconfDiscoveryNode();
+ RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
+ new RestconfApiCallNode(new RestapiCallNode()));
rdn.establishSubscription(p, ctx);
}
@@ -84,7 +90,8 @@ public class TestRestconfDiscoveryNode {
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("restapi-result.response-code", "200");
ctx.setAttribute("response-code", "404");
- RestconfDiscoveryNode rdn = new RestconfDiscoveryNode();
+ RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
+ new RestconfApiCallNode(new RestapiCallNode()));
assertThat(rdn.getResponseCode("restapi-result", ctx),
is("200"));
assertThat(rdn.getResponseCode(null, ctx),
@@ -95,10 +102,12 @@ public class TestRestconfDiscoveryNode {
public void testOutputIdentifier() {
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("restapi-result.ietf-subscribed-notifications:" +
- "output.identifier", "89");
- ctx.setAttribute("ietf-subscribed-notifications:output.identifier",
+ "establish-subscription.output.identifier",
"89");
- RestconfDiscoveryNode rdn = new RestconfDiscoveryNode();
+ ctx.setAttribute("ietf-subscribed-notifications:establish-subscripti" +
+ "on.output.identifier", "89");
+ RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
+ new RestconfApiCallNode(new RestapiCallNode()));
assertThat(rdn.getOutputIdentifier("restapi-result", ctx),
is("89"));
}