From 8b39ca99c8a49197b05f8fea7de9a1606c810e63 Mon Sep 17 00:00:00 2001 From: Ganesh Chandrasekaran Date: Tue, 24 Jul 2018 16:40:14 +0900 Subject: SSHApiCallNode sshExec API Impl Issue-ID: CCSDK-385 Change-Id: I430f9075ced10edb49062fc12091774e91611b32 Signed-off-by: Ganesh Chandrasekaran --- .../ccsdk/sli/plugins/sshapicall/TestJsonParser.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sshapi-call-node/provider/src/test/java') 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 mm = JsonParser.convertToProperties(b.toString()); + Map 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 mm = null; + try { + mm = JsonParser.convertToProperties(null); + } catch (JSONException e){ + throw new SvcLogicException(e.getMessage()); + } } private void logProperties(Map mm) { -- cgit 1.2.3-korg