summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'rulemgt/src/test')
-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);