added test case to TestXSLTTransformerNode 63/73663/3
authorSandeep J <sandeejh@in.ibm.com>
Tue, 27 Nov 2018 11:53:34 +0000 (17:23 +0530)
committerTakamune Cho <takamune.cho@att.com>
Wed, 28 Nov 2018 01:44:44 +0000 (01:44 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: I4e185d1c1117f0bab6a63618621b55aef376a2c9
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 b9aa20f..0c6e77f 100644 (file)
@@ -6,7 +6,7 @@
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
- * Modification Copyright (C) 2018 IBM.
+ * Modifications 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.
@@ -76,4 +76,14 @@ public class TestXSLTTransformerNode {
         inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_DATA, "testTemplateData");
         transformerNode.transformData(inParams, ctx);
    }
+    
+    @Test(expected=SvcLogicException.class)
+    public void testTransformDataForEmptyRequestTemplate() 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");
+        inParams.put(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE, "NO_SUCH_FILE.json");
+        transformerNode.transformData(inParams, ctx);
+   }
 }