added test case to TestAnsibleMessageParser.java 76/78376/4
authorSandeep J <sandeejh@in.ibm.com>
Wed, 13 Feb 2019 10:02:31 +0000 (15:32 +0530)
committerTakamune Cho <takamune.cho@att.com>
Thu, 14 Feb 2019 14:20:14 +0000 (14:20 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Ic0546d8cff108551d32bb7db71238e1c968d0bef
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/test/java/org/onap/appc/adapter/ansible/model/TestAnsibleMessageParser.java

index 9a4690e..6d2e7bb 100644 (file)
@@ -183,4 +183,17 @@ public class TestAnsibleMessageParser {
         assertEquals("TestUser",result.get("User"));
         assertEquals("TestPassword",result.get("Password"));
     }
+    
+    @Test
+    public void testReqUriResultWithIPs() throws Exception {
+        Map<String, String> params = new HashMap<>();
+        params.put("AgentUrl", "http://xx:yy:zz");
+        params.put("Id", "TestId");
+        params.put("User", "TestUser");
+        params.put("Password", "TestPassword");
+        String serverIp="10.0.2.3";
+        String actual=msgParser.reqUriResultWithIP(params, serverIp);
+        String expected= "http://10.0.2.3:yy:zz?Id=TestId&Type=GetResult";
+        assertEquals(expected, actual);
+    }
 }