aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-08 17:22:02 +0530
committerTakamune Cho <tc012c@att.com>2018-08-09 15:20:39 +0000
commit2ee3f36f8de9f5a94a8c91e78d27453fc309cbc8 (patch)
tree50d272271b3e2d61b98afcd4b6eb0e7f1d12d7bb
parent73d1eb965ffa81033864609311a4dbd406c45ad9 (diff)
added test case to TestConvertNode.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: If2320397a735dd4f510350802df631cb132145e8 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/convert/TestConvertNode.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/convert/TestConvertNode.java b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/convert/TestConvertNode.java
index 979a001b1..b084ba3bb 100644
--- a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/convert/TestConvertNode.java
+++ b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/convert/TestConvertNode.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
@@ -23,7 +25,7 @@
package org.onap.sdnc.config.generator.convert;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -159,4 +161,18 @@ public class TestConvertNode {
convertNode.unEscapeData(inParams, ctx);
}
+
+ @Test
+ public void testEscapeDataForValidUnescapeDataString() throws Exception {
+ SvcLogicContext ctx = new SvcLogicContext();
+ Map<String, String> inParams = new HashMap<String, String>();
+ String unescapeData = "testUnescapeData";
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_UNESCAPE_DATA, unescapeData);
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_DATA_TYPE,
+ ConfigGeneratorConstant.DATA_TYPE_SQL);
+ ConvertNode convertNode = new ConvertNode();
+ convertNode.escapeData(inParams, ctx);
+ assertEquals(unescapeData, ctx.getAttribute("test." + ConfigGeneratorConstant.OUTPUT_PARAM_ESCAPE_DATA));
+ }
}