diff options
author | Michael Lando <ml636r@att.com> | 2018-06-02 16:51:08 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-06-02 16:51:08 +0300 |
commit | 96d2a02c0950b6f91f4334163333b46a93b05e5f (patch) | |
tree | 0b92fe37a054ce59a1b5aa33a8eedc65c9258faf /catalog-dao/src/main/java/org | |
parent | d582d5ef41bdfd035de7834ea275fb8593ee3308 (diff) |
new unit tests for sdc-dao
Change-Id: Ie19279acdd0f656f3b9aeb5a82935c98051ee472
Issue-ID: SDC-1333
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-dao/src/main/java/org')
-rw-r--r-- | catalog-dao/src/main/java/org/openecomp/sdc/be/dao/utils/DaoUtils.java | 10 |
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 } |