added test case to TestPropertyDefinitionNode.java 29/62029/3
authorSandeep J <sandeejh@in.ibm.com>
Thu, 23 Aug 2018 09:29:35 +0000 (14:59 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 23 Aug 2018 20:45:59 +0000 (20:45 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: I7a07ce47115eff276217addc92baf1df15bdb06e
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-config/appc-config-params/provider/src/test/java/org/onap/sdnc/config/params/parser/TestPropertyDefinitionNode.java

index 6a9fe55..4c0b602 100644 (file)
@@ -215,5 +215,19 @@ public class TestPropertyDefinitionNode {
         SvcLogicContext ctx = new SvcLogicContext();
         propertyDefinitionNode.validateParams(inParams, ctx);
     }
+    
+    @Test
+    public void testValidateParamsForEmptyConfigParams() throws Exception
+    {
+        Map<String, String> inParams = new HashMap<String, String>();
+        String jsonData = IOUtils.toString(
+                TestPropertyDefinitionNode.class.getClassLoader().getResourceAsStream("parser/pd.yaml"),
+                Charset.defaultCharset());
+        inParams.put(ParamsHandlerConstant.INPUT_PARAM_PD_CONTENT, jsonData);
+        SvcLogicContext ctx = new SvcLogicContext();
+        propertyDefinitionNode.validateParams(inParams, ctx);
+        String status = ctx.getAttribute("status");
+        assertEquals(ParamsHandlerConstant.OUTPUT_STATUS_SUCCESS,status);
+    }
 
 }