aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2018-05-30 18:19:45 +0300
committerTal Gitelman <tg851x@intl.att.com>2018-05-30 18:22:06 +0300
commita108e8bce15c71acec55b2d20cff546c0ae0a647 (patch)
treea610dda58bd0acba8cef6b7945ae986b59830dfe /catalog-dao/src/main/java/org/openecomp
parent5a0a74f55f9661b218faff2f2ba710dc9a4f5443 (diff)
new unit tests for sdc-dao
Change-Id: I734ad9a0ef636ed6a2d70ff68dd06036bf2447e3 Issue-ID: SDC-1333 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-dao/src/main/java/org/openecomp')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java
index b21d1e9630..35941dea89 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java
@@ -29,7 +29,11 @@ import com.google.gson.Gson;
* Utility class for convertation to/from JSON string
*/
public class DaoUtils {
-
+
+ private DaoUtils() {
+
+ }
+
/**
* Convert from Object to Json string
*
@@ -52,6 +56,10 @@ public class DaoUtils {
* @return object
*/
public static <T> T convertFromJson(Class<T> clazz, String json) {
+ if (clazz == null) {
+ throw new RuntimeException("The Class cannot be NULL!!!");
+ }
+
Gson gson = new Gson(); // Or use new GsonBuilder().create();
return gson.fromJson(json, clazz); // deserializes json into target2
}