summaryrefslogtreecommitdiffstats
path: root/appc-config/appc-config-audit
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-07-23 16:32:19 +0530
committerTakamune Cho <tc012c@att.com>2018-07-24 15:07:19 +0000
commit6ec3768894509d14aba3aba041803e2c04fd22eb (patch)
tree3e9d8145bb1c47489b3e64f04148c80f46b792a7 /appc-config/appc-config-audit
parent9fa2ece15b6389389782a56061a919d2a239540d (diff)
added test case to TestCompareNodeCli.java
added test case to increase code coverage. A part of the else block in compare method of CompareNode.java was not being covered. Getting covered now with this test case. Issue-ID: APPC-1086 Change-Id: I2821ec0c5d9203f5c76e6a091c6734f41333d638 Signed-off-by: Sandeep Jha<sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config/appc-config-audit')
-rw-r--r--appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeCli.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeCli.java b/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeCli.java
index 48349c819..bd28ef7a3 100644
--- a/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeCli.java
+++ b/appc-config/appc-config-audit/provider/src/test/java/org/onap/sdnc/config/audit/node/TestCompareNodeCli.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * 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.
* You may obtain a copy of the License at
@@ -32,6 +34,7 @@ import org.slf4j.LoggerFactory;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import static org.junit.Assert.assertEquals;
public class TestCompareNodeCli {
private static final Logger log = LoggerFactory.getLogger(TestCompareNodeCli.class);
@@ -47,6 +50,16 @@ public class TestCompareNodeCli {
cmp.compare(testMap, ctx);
assert (ctx.getAttribute("STATUS").equals("SUCCESS"));
}
+
+ @Test
+ public void TestCompareCliForNoPayload() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ HashMap<String, String> testMap = new HashMap<String, String>();
+ CompareNode cmp = new CompareNode();
+ testMap.put("compareDataType", "Cli");
+ cmp.compare(testMap, ctx);
+ assertEquals ("FAILURE",ctx.getAttribute("STATUS"));
+ }
@Test
public void TestCompareCliFordifferentPayload() throws SvcLogicException {