summaryrefslogtreecommitdiffstats
path: root/appc-config
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-08 17:34:04 +0530
committerTakamune Cho <tc012c@att.com>2018-08-09 15:21:07 +0000
commit6074b773516e3e02a4c6517fd1f4cf5a9c19b86b (patch)
treebda0cdb294789dca20af4587a76093acc43c19ac /appc-config
parent2ee3f36f8de9f5a94a8c91e78d27453fc309cbc8 (diff)
added test case to TestMergeNode.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: If9a93361b275df98412dc23410a2094e340b7c9c Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config')
-rw-r--r--appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java
index 20cad53f3..e56b29be4 100644
--- a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java
+++ b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java
@@ -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
@@ -24,6 +26,8 @@
package org.onap.sdnc.config.generator.merge;
import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.IOUtils;
@@ -98,6 +102,21 @@ public class TestMergeNode {
Map<String, String> inParams = new HashMap<String, String>();
mergeNode.mergeDataOnTemplate(inParams, ctx);
}
+
+ @Test
+ public void testMmergeDataOnTemplateWithTemplateData() throws SvcLogicException, IOException {
+ MergeNode mergeNode = new MergeNode();
+ Map<String, String> inParams = new HashMap<String, String>();
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
+ String jsonData = "{name1:value1,name2:value2}";
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_JSON_DATA, jsonData);
+ String templateData = "testTemplateData";
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, templateData);
+ SvcLogicContext ctx = new SvcLogicContext();
+ mergeNode.mergeJsonDataOnTemplate(inParams, ctx);
+ assertEquals(ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS,ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS));
+
+ }
@Test
public void mergeYamlDataOnTemplate() throws SvcLogicException {