rcn.sendRequest(p, ctx);
}
+ @Test
+ public void testJsonSdwanVpnTopologyTemplate() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ ctx.setAttribute("prop.topology", "topoType");
+
+ ctx.setAttribute("prop.roles_length", "1");
+ ctx.setAttribute("prop.roles[0]", "role1");
+
+ ctx.setAttribute("prop.siteAttachement_length", "2");
+
+ ctx.setAttribute("prop.siteAttachement[0].siteId", "site1");
+ ctx.setAttribute("prop.siteAttachement[0].roles_length", "0");
+ ctx.setAttribute("prop.siteAttachement[0].roles[0]", "role1");
+ ctx.setAttribute("prop.siteAttachement[0].roles[1]", "role3");
+
+ ctx.setAttribute("prop.siteAttachement[1].siteId", "site2");
+ ctx.setAttribute("prop.siteAttachement[1].roles_length", "1");
+ ctx.setAttribute("prop.siteAttachement[1].roles[0]", "role2");
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("templateFileName", "src/test/resources/sdwan-vpn-topology.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", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
+ @Test
+ public void testJsonSdwanSiteTemplate() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+
+ ctx.setAttribute("prop.name", "site1");
+
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("templateFileName", "src/test/resources/sdwan-site.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", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
+
@Test
public void testJsonTemplate() throws SvcLogicException {
SvcLogicContext ctx = new SvcLogicContext();
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 {