added test cases to TestXSLTTransformerNode.java 25/59825/7
authorSandeep J <sandeejh@in.ibm.com>
Thu, 9 Aug 2018 09:55:36 +0000 (15:25 +0530)
committerTakamune Cho <tc012c@att.com>
Fri, 17 Aug 2018 14:39:07 +0000 (14:39 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: If07e899b03ba416b94675dfdcf1e45c5c365822d
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/transform/TestXSLTTransformerNode.java

index 65214b8..b9aa20f 100644 (file)
@@ -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);
+   }
 }