summaryrefslogtreecommitdiffstats
path: root/sshapi-call-node/provider/src/test/java
diff options
context:
space:
mode:
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) {