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;
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);
@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) {