diff options
Diffstat (limited to 'appc-config/appc-config-generator/provider/src/test')
-rw-r--r-- | appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/merge/TestMergeNode.java | 19 |
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 { |