From 2ee3f36f8de9f5a94a8c91e78d27453fc309cbc8 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 8 Aug 2018 17:22:02 +0530 Subject: added test case to TestConvertNode.java to increase code coverage Issue-ID: APPC-1086 Change-Id: If2320397a735dd4f510350802df631cb132145e8 Signed-off-by: Sandeep J --- .../sdnc/config/generator/convert/TestConvertNode.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'appc-config/appc-config-generator/provider/src/test') 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 inParams = new HashMap(); + 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)); + } } -- cgit 1.2.3-korg