summaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/test/java
diff options
context:
space:
mode:
authorGaurav Agrawal <gaurav.agrawal@huawei.com>2019-04-12 10:08:20 +0530
committerTimoney, Dan (dt5972) <dtimoney@att.com>2019-04-16 10:05:39 -0400
commite4c9cfddd142785d527f29ff5c2b5883cc255033 (patch)
treeab44bcdba586a8f9d04ef7cb28c478e7dd99d611 /restapi-call-node/provider/src/test/java
parent2f860ff302a9583a49a08524a5fcdd7435ee2359 (diff)
Add support for multi part form data
Add support for multipart form data in CCSDK Change-Id: Iacc35efe28b9d91afcfc1e87e0faf41fc74d5c8a Issue-ID: CCSDK-239 Signed-off-by: Gaurav Agrawal <gaurav.agrawal@huawei.com>
Diffstat (limited to 'restapi-call-node/provider/src/test/java')
-rw-r--r--restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java27
1 files changed, 27 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 fd982d76..5b047e4e 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
@@ -224,6 +224,33 @@ public class TestRestapiCallNode {
rcn.sendRequest(p, ctx);
}
+ @Test(expected = SvcLogicException.class)
+ public void testFormData() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ ctx.setAttribute("tmp.sdn-circuit-req-row_length", "1");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].source-uid", "APIDOC-123");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].action", "delete");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-timestamp", "2016-09-09 16:30:35.0");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].request-status", "New");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].processing-status", "New");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].service-clfi", "testClfi1");
+ ctx.setAttribute("tmp.sdn-circuit-req-row[0].clci", "clci");
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("templateFileName", "src/test/resources/test-template.json");
+ p.put("restapiUrl", "http://echo.getpostman.com");
+ p.put("restapiUser", "user1");
+ p.put("restapiPassword", "abc123");
+ p.put("format", "json");
+ p.put("httpMethod", "post");
+ p.put("responsePrefix", "response");
+ p.put("skipSending", "false");
+ p.put("multipartFormData", "true");
+ p.put("multipartFile", "src/test/resources/test-template.json");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
@Test(expected = SvcLogicException.class)
public void testWithInvalidURI() throws SvcLogicException {