summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'rulemgt/src/test/java')
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleActiveAppTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleActiveAppTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleAppConfigTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleAppConfigTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleQueryConditionTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleQueryConditionTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleResult4APITest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleResult4APITest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java)4
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java)21
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java)15
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java)2
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/resources/RuleMgtResourcesTest.java)18
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java)59
18 files changed, 70 insertions, 73 deletions
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleActiveAppTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleActiveAppTest.java
index 4f35b94..cd79ae8 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleActiveAppTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleActiveAppTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt;
+package org.onap.holmes.rulemgt;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleAppConfigTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleAppConfigTest.java
index d14e55e..d411603 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleAppConfigTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleAppConfigTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt;
+package org.onap.holmes.rulemgt;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNull.notNullValue;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java
index 59e020c..e292e16 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java
index 8a9b8ec..418ff41 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.junit.Assert.*;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java
index 5f3c5c1..e616a71 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java
@@ -15,7 +15,7 @@
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequestTest.java
index 3f5469d..54fa132 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequestTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java
index f9a09ff..3d49b2f 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleQueryConditionTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleQueryConditionTest.java
index 8bb5b8b..36d5024 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleQueryConditionTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleQueryConditionTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java
index 4cd4744..9f24c0c 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java
index 82731d6..a7db0fe 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import static org.junit.Assert.*;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java
index c6e0a7e..fa423db 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleResult4APITest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleResult4APITest.java
index 3af245e..2c006ab 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleResult4APITest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleResult4APITest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java
index f4275eb..b3cb93d 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java
@@ -15,7 +15,7 @@
*/
-package org.openo.holmes.rulemgt.bolt.enginebolt;
+package org.onap.holmes.rulemgt.bolt.enginebolt;
import org.apache.http.HttpResponse;
@@ -25,7 +25,7 @@ import org.apache.http.impl.client.HttpClients;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.rule.PowerMockRule;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java
index 38afa47..b63b106 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bolt.enginebolt;
+package org.onap.holmes.rulemgt.bolt.enginebolt;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -27,10 +27,9 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.common.exception.CorrelationException;
import org.powermock.api.easymock.PowerMock;
import org.powermock.reflect.Whitebox;
@@ -54,7 +53,7 @@ public class EngineWrapperTest {
@Test
public void deployEngine_invoke_rule_deploy_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CALL_DEPLOY_RULE_REST_FAILED);
+ thrown.expectMessage("Failed to call the rule deployment RESTful API.");
EasyMock.expect(engineServiceMock.deploy(EasyMock.anyObject(CorrelationDeployRule4Engine.class))).andThrow(
new RuntimeException(""));
@@ -68,7 +67,7 @@ public class EngineWrapperTest {
@Test
public void deployEngine_http_status_not_ok() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.ENGINE_DEPLOY_RULE_FAILED);
+ thrown.expectMessage("Failed to deploy the rule!");
EasyMock.expect(engineServiceMock.deploy(EasyMock.anyObject(CorrelationDeployRule4Engine.class)))
.andReturn(response);
@@ -85,7 +84,7 @@ public class EngineWrapperTest {
String content = "";
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_PARSE_DEPLOY_RESULT_ERROR);
+ thrown.expectMessage("Failed to parse the value returned by the engine management service.");
EasyMock.expect(engineServiceMock.deploy(EasyMock.anyObject(CorrelationDeployRule4Engine.class)))
.andReturn(response);
EasyMock.expect(response.getStatus()).andReturn(200);
@@ -115,7 +114,7 @@ public class EngineWrapperTest {
@Test
public void deleteRuleFromEngine_invoke_rule_delete_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CALL_DELETE_RULE_REST_FAILED);
+ thrown.expectMessage("Failed to call the rule deleting RESTful API.");
EasyMock.expect(engineServiceMock.delete(EasyMock.anyObject(String.class))).andThrow(
new RuntimeException(""));
@@ -129,7 +128,7 @@ public class EngineWrapperTest {
@Test
public void deleteRuleFromEngine_http_status_not_ok() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_DELETE_RULE_FAILED);
+ thrown.expectMessage("Failed to delete the rule!");
EasyMock.expect(engineServiceMock.delete(EasyMock.anyObject(String.class)))
.andReturn(response);
@@ -158,7 +157,7 @@ public class EngineWrapperTest {
@Test
public void checkRuleFromEngine_rule_delete_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CALL_CHECK_RULE_REST_FAILED);
+ thrown.expectMessage("Failed to call the rule verification RESTful API.");
EasyMock.expect(engineServiceMock.check(EasyMock.anyObject(CorrelationCheckRule4Engine.class))).andThrow(
new RuntimeException(""));
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java
index f241484..3854cdc 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.db;
+package org.onap.holmes.rulemgt.db;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -30,11 +30,10 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.DbDaoUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.DbDaoUtil;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
import org.powermock.api.easymock.PowerMock;
import org.powermock.modules.junit4.rule.PowerMockRule;
import org.powermock.reflect.Whitebox;
@@ -76,7 +75,7 @@ public class CorrelationRuleQueryDaoTest {
public void getCorrelationRulesByCondition_db_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED);
+ thrown.expectMessage("Failed to query the rule.");
EasyMock.expect(dbDaoUtil.getHandle()).andReturn(handle);
EasyMock.expect(handle.createQuery(EasyMock.anyObject(String.class))).andReturn(query);
@@ -110,7 +109,7 @@ public class CorrelationRuleQueryDaoTest {
@Test
public void getCorrelationRulesByCondition_get_where_sql_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED);
+ thrown.expectMessage("An error occurred while building the query SQL.");
EasyMock.expect(dbDaoUtil.getHandle()).andReturn(handle);
EasyMock.expect(handle.createQuery(EasyMock.anyObject(String.class))).andReturn(query);
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java
index 65a53dd..bcf56ca 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.db.mapper;
+package org.onap.holmes.rulemgt.db.mapper;
import static org.easymock.EasyMock.expect;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/resources/RuleMgtResourcesTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java
index 16a547b..dd68ad8 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/resources/RuleMgtResourcesTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.resources;
+package org.onap.holmes.rulemgt.resources;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.WebApplicationException;
@@ -24,14 +24,14 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.rulemgt.bean.request.RuleCreateRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleDeleteRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.bean.request.RuleUpdateRequest;
-import org.openo.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleQueryListResponse;
-import org.openo.holmes.rulemgt.wrapper.RuleMgtWrapper;
+import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleDeleteRequest;
+import org.onap.holmes.rulemgt.wrapper.RuleMgtWrapper;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.bean.request.RuleUpdateRequest;
+import org.onap.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
+import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
import org.powermock.api.easymock.PowerMock;
import org.powermock.reflect.Whitebox;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java
index f6d0544..0c81b98 100644
--- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.wrapper;
+package org.onap.holmes.rulemgt.wrapper;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
@@ -29,21 +29,20 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.DbDaoUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.RuleCreateRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleDeleteRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.bean.request.RuleUpdateRequest;
-import org.openo.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleQueryListResponse;
-import org.openo.holmes.rulemgt.bolt.enginebolt.EngineWrapper;
-import org.openo.holmes.rulemgt.db.CorrelationRuleDao;
-import org.openo.holmes.rulemgt.db.CorrelationRuleQueryDao;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.db.CorrelationRuleDao;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.DbDaoUtil;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleDeleteRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.bean.request.RuleUpdateRequest;
+import org.onap.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
+import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
+import org.onap.holmes.rulemgt.bolt.enginebolt.EngineWrapper;
+import org.onap.holmes.rulemgt.db.CorrelationRuleQueryDao;
import org.powermock.api.easymock.PowerMock;
import org.powermock.modules.junit4.rule.PowerMockRule;
import org.powermock.reflect.Whitebox;
@@ -93,7 +92,7 @@ public class RuleMgtWrapperTest {
@Test
public void addCorrelationRule_name_is_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_RULE_NAME_CANNOT_BE_EMPTY);
+ thrown.expectMessage("The name of the rule can not be empty.");
ruleMgtWrapper.addCorrelationRule(USER_NAME, createRuleCreateRequest(null, "This is a rule for testing.",
"Mocked contents.", 0));
@@ -102,7 +101,7 @@ public class RuleMgtWrapperTest {
@Test
public void addCorrelationRule_request_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY));
+ thrown.expectMessage("The request object can not be empty!");
ruleMgtWrapper.addCorrelationRule(USER_NAME, null);
}
@@ -110,7 +109,7 @@ public class RuleMgtWrapperTest {
@Test
public void addCorrelationRule_name_is_empty() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_RULE_NAME_CANNOT_BE_EMPTY);
+ thrown.expectMessage("The name of the rule can not be empty.");
ruleMgtWrapper.addCorrelationRule("admin", createRuleCreateRequest("", "This is a rule for testing.",
"Mocked contents.", 0));
@@ -119,7 +118,7 @@ public class RuleMgtWrapperTest {
@Test
public void addCorrelationRule_content_is_empty() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CONTENT_CANNOT_BE_EMPTY);
+ thrown.expectMessage("The contents of the rule can not be empty!");
ruleMgtWrapper.addCorrelationRule("admin", createRuleCreateRequest("test", "This is a rule for testing.",
"", 0));
@@ -128,7 +127,7 @@ public class RuleMgtWrapperTest {
@Test
public void addCorrelationRule_enabled_is_off_limit() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR);
+ thrown.expectMessage("Invalid rule status. Only 0 (disabled) and 1 (enabled) are allowed.");
ruleMgtWrapper.addCorrelationRule("admin", createRuleCreateRequest("test", "This is a rule for testing.",
"Mocked contents.", 3));
@@ -144,7 +143,7 @@ public class RuleMgtWrapperTest {
CorrelationRule correlationRule = convertCreateRequest2CorrelationRule(ruleCreateRequest);
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_REPEAT_RULE_NAME);
+ thrown.expectMessage("A rule with the same name already exists.");
EasyMock.expect(correlationRuleDaoMock.queryRuleByRuleName(ruleName)).andReturn(correlationRule);
PowerMock.replayAll();
@@ -183,7 +182,7 @@ public class RuleMgtWrapperTest {
@Test
public void updateCorrelationRule_param_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY);
+ thrown.expectMessage("The request object can not be empty!");
ruleMgtWrapper.updateCorrelationRule(USER_NAME, null);
}
@@ -241,7 +240,7 @@ public class RuleMgtWrapperTest {
@Test
public void updateCorrelationRule_rule_not_exist() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_RULE_NOT_EXIST_DATABASE);
+ thrown.expectMessage("You're trying to update a rule which does not exist in the system.");
EasyMock.expect(correlationRuleDaoMock.queryRuleByRid(EasyMock.anyObject(String.class))).andReturn(null);
@@ -255,7 +254,7 @@ public class RuleMgtWrapperTest {
@Test
public void deleteCorrelationRule_request_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY));
+ thrown.expectMessage("The request object can not be empty!");
ruleMgtWrapper.deleteCorrelationRule(null);
}
@@ -263,7 +262,7 @@ public class RuleMgtWrapperTest {
@Test
public void deleteCorrelationRule_rule_not_exit() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_RULE_NOT_EXIST_DATABASE));
+ thrown.expectMessage("You're trying to delete a rule which does not exist in the system.");
RuleDeleteRequest ruleDeleteRequest = createRuleDeleteRequest("rule_" + System.currentTimeMillis());
@@ -299,11 +298,11 @@ public class RuleMgtWrapperTest {
@Test
public void getCorrelationRuleByCondition_data_format_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED));
+ thrown.expectMessage("An error occurred while building the query SQL.");
EasyMock.expect(correlationRuleQueryDaoMock.getCorrelationRulesByCondition(EasyMock.anyObject(
RuleQueryCondition.class)))
- .andThrow(new CorrelationException(I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED));
+ .andThrow(new CorrelationException("An error occurred while building the query SQL."));
PowerMock.replay(correlationRuleQueryDaoMock, CorrelationRuleQueryDao.class);
@@ -315,11 +314,11 @@ public class RuleMgtWrapperTest {
@Test
public void getCorrelationRuleByCondition_db_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED));
+ thrown.expectMessage("Failed to query the rule.");
EasyMock.expect(correlationRuleQueryDaoMock.getCorrelationRulesByCondition(EasyMock.anyObject(
RuleQueryCondition.class)))
- .andThrow(new CorrelationException(I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED));
+ .andThrow(new CorrelationException("Failed to query the rule."));
PowerMock.replay(correlationRuleQueryDaoMock, CorrelationRuleQueryDao.class);