summaryrefslogtreecommitdiffstats
path: root/sshapi-call-node/provider/src/test
diff options
context:
space:
mode:
authorDan Timoney <dt5972@att.com>2018-07-27 20:52:48 +0000
committerGerrit Code Review <gerrit@onap.org>2018-07-27 20:52:48 +0000
commitbace9b5f98bfef3168134a747c8795196ce9a723 (patch)
tree707bcf95399eb7f875581439b1b40e99f13f0655 /sshapi-call-node/provider/src/test
parentbe3d4606d9627e5dfb461b72140f7be52e1c7776 (diff)
parent8b39ca99c8a49197b05f8fea7de9a1606c810e63 (diff)
Merge "SSHApiCallNode sshExec API Impl"
Diffstat (limited to 'sshapi-call-node/provider/src/test')
-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) {