aboutsummaryrefslogtreecommitdiffstats
path: root/appc-config/appc-config-generator
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-09 15:25:36 +0530
committerTakamune Cho <tc012c@att.com>2018-08-17 14:39:07 +0000
commitc7df8822f644fbaea27ef63a01dfbe05acb39eab (patch)
tree725a11b6cab626cdf6c0bdadeae9592998835d8b /appc-config/appc-config-generator
parent1e949faf227826dd19e3ba395d8b773cc39bded4 (diff)
added test cases to TestXSLTTransformerNode.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: If07e899b03ba416b94675dfdcf1e45c5c365822d Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config/appc-config-generator')
-rw-r--r--appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.java20
1 files changed, 19 insertions, 1 deletions
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<String, String> inParams = new HashMap<String, String>();
+ 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<String, String> inParams = new HashMap<String, String>();
+ XSLTTransformerNode transformerNode = new XSLTTransformerNode();
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, "testTemplateData");
+ transformerNode.transformData(inParams, ctx);
+ }
}