added test case to TestPatternNode.java 61/59661/4
authorSandeep J <sandeejh@in.ibm.com>
Wed, 8 Aug 2018 12:09:08 +0000 (17:39 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 9 Aug 2018 15:27:02 +0000 (15:27 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: I4d035ffb81367fd4de4004d4aefa8a6433e4fd7d
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java

index 9b94e62..c1f66f2 100644 (file)
@@ -6,6 +6,8 @@
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
+ * Modification Copyright (C) 2018 IBM.
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -94,4 +96,15 @@ public class TestPatternNode {
         assertEquals(ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS),
                 ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
     }
+    
+    @Test
+    public void testCheckDataType() throws Exception {
+        PatternNode patternNode = new PatternNode();
+        Map<String, String> inParams = new HashMap<String, String>();
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_CHECK_DATA, "testData");
+        SvcLogicContext ctx = new SvcLogicContext();
+        patternNode.checkDataType(inParams, ctx);
+        assertEquals(ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS,ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS));
+    }
 }