summaryrefslogtreecommitdiffstats
path: root/sshapi-call-node/provider/src/test/java
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-24 16:40:14 +0900
committerGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-24 18:05:43 +0900
commit8b39ca99c8a49197b05f8fea7de9a1606c810e63 (patch)
treee32f32de0f9190046e04ac685751c434008fb09c /sshapi-call-node/provider/src/test/java
parentd6a56cd8f71cc196083c6ab16e86d24c7c89f9ef (diff)
SSHApiCallNode sshExec API Impl
Issue-ID: CCSDK-385 Change-Id: I430f9075ced10edb49062fc12091774e91611b32 Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'sshapi-call-node/provider/src/test/java')
-rw-r--r--sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java
index 9df790ae3..66be73001 100644
--- a/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java
+++ b/sshapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/sshapicall/TestJsonParser.java
@@ -31,6 +31,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
+import org.codehaus.jettison.json.JSONException;
import org.junit.Test;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.plugins.sshapicall.model.JsonParser;
@@ -50,8 +51,12 @@ public class TestJsonParser {
String line;
while ((line = in.readLine()) != null)
b.append(line).append('\n');
-
- Map<String, String> mm = JsonParser.convertToProperties(b.toString());
+ Map<String, String> mm = null;
+ try {
+ mm = JsonParser.convertToProperties(b.toString());
+ } catch (JSONException e){
+ throw new SvcLogicException(e.getMessage());
+ }
logProperties(mm);
@@ -60,7 +65,12 @@ public class TestJsonParser {
@Test(expected = NullPointerException.class)
public void testNullString() throws SvcLogicException {
- JsonParser.convertToProperties(null);
+ Map<String, String> mm = null;
+ try {
+ mm = JsonParser.convertToProperties(null);
+ } catch (JSONException e){
+ throw new SvcLogicException(e.getMessage());
+ }
}
private void logProperties(Map<String, String> mm) {