summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test/java/org/onap
diff options
context:
space:
mode:
authorYiLi <li.yi101@zte.com.cn>2018-02-27 15:26:41 +0800
committerYiLi <li.yi101@zte.com.cn>2018-02-27 17:45:43 +0800
commitd2e0902630ccf06bb466360e036212f5060b9055 (patch)
tree6d87843690537bbd90b5577e0f8e489fbe268ad4 /rulemgt/src/test/java/org/onap
parent4be2442687589c409a469188696d7605979881ee (diff)
Replace Jackson with GSON
Change-Id: Ifffe7aca1116e2706d66ecb682697df521785b57 Issue-ID: HOLMES-115 Signed-off-by: YiLi <li.yi101@zte.com.cn>
Diffstat (limited to 'rulemgt/src/test/java/org/onap')
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java5
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java3
2 files changed, 5 insertions, 3 deletions
diff --git a/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java
index a330306..8d16198 100644
--- a/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java
@@ -21,6 +21,7 @@ import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.powermock.api.mockito.PowerMockito.when;
+import com.alibaba.fastjson.JSONException;
import com.fasterxml.jackson.databind.ObjectMapper;
import javax.ws.rs.ProcessingException;
import org.junit.Before;
@@ -57,13 +58,13 @@ public class DcaeConfigurationPollingTest {
public void testDaceConfigurationPolling_getDcaeConfigurations_exception() throws Exception {
PowerMock.resetAll();
thrown.expect(CorrelationException.class);
- thrown.expectMessage("host");
+ thrown.expectMessage("syntax error, pos 1");
PowerMockito.mockStatic(MicroServiceConfig.class);
when(MicroServiceConfig.getServiceConfigInfoFromCBS("holmes-rule-mgmt"))
.thenReturn("host");
PowerMock.createMock(DcaeConfigurationParser.class);
PowerMock.expectPrivate(DcaeConfigurationParser.class, "parse", "host")
- .andThrow(new CorrelationException("tests")).anyTimes();
+ .andThrow(new CorrelationException("")).anyTimes();
PowerMock.replayAll();
Whitebox.invokeMethod(daceConfigurationPolling, "getDcaeConfigurations");
diff --git a/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java
index 692cc19..0c3bd89 100644
--- a/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java
@@ -16,6 +16,7 @@
package org.onap.holmes.rulemgt.resources;
+import com.google.gson.JsonSyntaxException;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.WebApplicationException;
import org.easymock.EasyMock;
@@ -147,7 +148,7 @@ public class RuleMgtResourcesTest {
@Test
public void getCorrelationRules_param_translate_exception() {
- thrown.expect(WebApplicationException.class);
+ thrown.expect(JsonSyntaxException.class);
String queryRequest = "this is error param";
EasyMock.expect(request.getHeader("language-option")).andReturn("en_US").times(2);