summaryrefslogtreecommitdiffstats
path: root/appc-dg
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-12 19:35:18 +0530
committerTakamune Cho <tc012c@att.com>2018-08-16 08:37:52 +0000
commit389995494bde4bb8b8293b7f9a0d07b267e19b57 (patch)
treee8befa10522d7f4c518577a9e43626400908a90e /appc-dg
parent455c7f386111838d37e89b0fcc26b9497caf2b62 (diff)
added test case to JSONUtilTest.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: I7fdf23f7692cd57e6a736307e038696431a25eb1 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-dg')
-rw-r--r--appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JSONUtilTest.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JSONUtilTest.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JSONUtilTest.java
index 0dff2e24d..37be0e10a 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JSONUtilTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JSONUtilTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright 2018 AT&T
*=================================================================================
+* Modifications Copyright 2018 IBM.
+*=================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -27,6 +29,7 @@ import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import java.io.FileReader;
+import java.io.IOException;
import java.io.FileNotFoundException;
import java.io.UncheckedIOException;
@@ -107,5 +110,10 @@ public class JSONUtilTest {
fail(uioe.getMessage() + " Unchecked IO exception encountered");
}
}
-
+
+ @Test(expected=UncheckedIOException.class)
+ public void testCatchSectionOfToJson() throws IOException
+ {
+ JSONUtil.toJson(new Object());
+ }
}