aboutsummaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/test
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-06-14 08:02:31 +0900
committerGanesh Chandrasekaran <ganesh.c@samsung.com>2018-06-14 08:07:33 +0900
commita87dc9c351b0c08d20adc428c215cf3934bb79bb (patch)
tree6fedec13ad8df0bc4ad00bc3818c678889efa38f /restapi-call-node/provider/src/test
parent600aab4f869d5b632f055dce5cb910ce1d5a348e (diff)
CCSDK plugin has authType param for DG to sel type
Issue-ID: CCSDK-299 Change-Id: I61a56c873189ccc6ba9985c5121d50e2ad1f3f48 Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'restapi-call-node/provider/src/test')
-rw-r--r--restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java137
1 files changed, 137 insertions, 0 deletions
diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java
index 88a1eeae..81806f6d 100644
--- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java
+++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java
@@ -435,4 +435,141 @@ public class TestRestapiCallNode {
RestapiCallNode rcn = new RestapiCallNode();
rcn.sendRequest(p, ctx);
}
+
+ @Test
+ public void testDeleteAuthTypeBasic() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("authType", "basic");
+ p.put("restapiUser", "admin");
+ p.put("restapiPassword", "admin123");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test
+ public void testDeleteAuthTypeDigest() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("authType", "digest");
+ p.put("restapiUser", "admin");
+ p.put("restapiPassword", "admin123");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test
+ public void testDeleteAuthTypeOAuth() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("authType", "oauth");
+ p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3");
+ p.put("oAuthConsumerSecret", "secret");
+ p.put("oAuthSignatureMethod", "plainTEXT");
+ p.put("oAuthVersion", "1.0");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test
+ public void testDeleteAuthTypeNoneOAuth() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3");
+ p.put("oAuthConsumerSecret", "secret");
+ p.put("oAuthSignatureMethod", "plainTEXT");
+ p.put("oAuthVersion", "1.0");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+ @Test
+ public void testDeleteAuthTypeNoneBasic() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("restapiUser", "admin");
+ p.put("restapiPassword", "admin123");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test(expected = SvcLogicException.class)
+ public void testInvalidDeleteAuthTypeOAuth() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("authType", "oauth");
+ p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3");
+ p.put("oAuthConsumerSecret", "secret");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test(expected = SvcLogicException.class)
+ public void testInvalidDeleteAuthTypeBasic() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("authType", "basic");
+ p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3");
+ p.put("oAuthConsumerSecret", "secret");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test(expected = SvcLogicException.class)
+ public void testInvalidDeleteAuthTypeDigest() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("restapiUrl", "https://echo.getpostman.com/delete");
+ p.put("authType", "digest");
+ p.put("oAuthConsumerKey", "f2a1ed52710d4533bde25be6da03b6e3");
+ p.put("oAuthConsumerSecret", "secret");
+ p.put("httpMethod", "delete");
+ p.put("format", "none");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
}