diff options
author | 2018-02-11 09:45:57 +0800 | |
---|---|---|
committer | 2018-02-11 10:02:21 +0800 | |
commit | d4a991ad631f16831d380eef8e7405d9c2ea85c5 (patch) | |
tree | cfee5a189c07c98105f1f22c168518a32b038ab4 /holmes-actions/src/test/java | |
parent | 37630177bc70661ce86cb12e9af34e8c09893f4d (diff) |
Test Replace Jackson with GSON
Change-Id: I2b4ada41d7a35d3427d574000bf1b3753e4d8d32
Issue-ID: HOLMES-115
Signed-off-by: YiLi <li.yi101@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/test/java')
-rw-r--r-- | holmes-actions/src/test/java/org/onap/holmes/common/utils/JacksonUtilTest.java | 59 | ||||
-rw-r--r-- | holmes-actions/src/test/java/org/onap/holmes/common/utils/Md5UtilTest.java | 1 |
2 files changed, 0 insertions, 60 deletions
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/JacksonUtilTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/JacksonUtilTest.java deleted file mode 100644 index 6fa9c11..0000000 --- a/holmes-actions/src/test/java/org/onap/holmes/common/utils/JacksonUtilTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/**
- * Copyright 2016 ZTE Corporation.
- *
- * 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
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.onap.holmes.common.utils;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-import java.lang.reflect.Type;
-import org.junit.Test;
-import org.onap.holmes.common.utils.bean.TestBean;
-
-public class JacksonUtilTest {
-
- @Test
- public void testBeanToJson() throws Exception {
- TestBean o = new TestBean();
- o.setId("id");
- String result = GsonUtil.beanToJson(o);
- assertThat("{\"id\":\"id\"}", equalTo(result));
- }
-
- @Test
- public void jsonToBean_json_null() throws Exception {
- String jsonNull = null;
- TestBean testBean = GsonUtil.jsonToBean(jsonNull, TestBean.class);
- assertThat(testBean, equalTo(null));
- }
-
- @Test
- public void jsonToBean_json_normal() throws Exception {
- String json = "{\"id\":\"id\"}";
- TestBean testBean = GsonUtil.jsonToBean(json, TestBean.class);
- assertThat(testBean.getId(), equalTo("id"));
- }
-
-}
\ No newline at end of file diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/Md5UtilTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/Md5UtilTest.java index af81a11..f6680a3 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/utils/Md5UtilTest.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/utils/Md5UtilTest.java @@ -20,7 +20,6 @@ import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.IsNot.not; import static org.junit.Assert.assertThat; -import com.fasterxml.jackson.core.JsonProcessingException; import org.junit.Test; import org.onap.holmes.common.dcae.entity.DcaeConfigurations; import org.onap.holmes.common.dcae.entity.SecurityInfo; |