From c7df8822f644fbaea27ef63a01dfbe05acb39eab Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Thu, 9 Aug 2018 15:25:36 +0530 Subject: added test cases to TestXSLTTransformerNode.java to increase code coverage Issue-ID: APPC-1086 Change-Id: If07e899b03ba416b94675dfdcf1e45c5c365822d Signed-off-by: Sandeep J --- .../generator/transform/TestXSLTTransformerNode.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'appc-config/appc-config-generator') diff --git a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.java b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.java index 65214b886..b9aa20f52 100644 --- a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.java +++ b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.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 @@ -33,6 +35,7 @@ import org.onap.sdnc.config.generator.ConfigGeneratorConstant; import org.onap.sdnc.config.generator.merge.TestMergeNode; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; public class TestXSLTTransformerNode { @@ -57,5 +60,20 @@ public class TestXSLTTransformerNode { + ctx.getAttribute(ConfigGeneratorConstant.OUTPUT_PARAM_TRANSFORMED_DATA)); } - + @Test(expected=SvcLogicException.class) + public void testTransformDataForEmptyTemplateData() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + Map inParams = new HashMap(); + inParams.put(ConfigGeneratorConstant.INPUT_PARAM_REQUEST_DATA, "testRequestData"); + XSLTTransformerNode transformerNode = new XSLTTransformerNode(); + transformerNode.transformData(inParams, ctx); + } + @Test(expected=SvcLogicException.class) + public void testTransformDataForEmptyRequestData() throws Exception { + SvcLogicContext ctx = new SvcLogicContext(); + Map inParams = new HashMap(); + XSLTTransformerNode transformerNode = new XSLTTransformerNode(); + inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, "testTemplateData"); + transformerNode.transformData(inParams, ctx); + } } -- cgit 1.2.3-korg