summaryrefslogtreecommitdiffstats
path: root/main/src/test/java
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2020-08-14 16:49:40 +0100
committera.sreekumar <ajith.sreekumar@bell.ca>2020-08-14 16:49:46 +0100
commitdb5b469ca8698f7bf7110389de08b8233dfc7d6d (patch)
tree9858cdc09ca53ff42be04ad131f6d40723e779fa /main/src/test/java
parentf91872a675d80c458c0ed17bacee81cc41adc639 (diff)
Using standard success/failure messages in PAP
Change-Id: If4613c0fc6f940bc82cf616aba2ba9cc03e1b599 Issue-ID: POLICY-2754 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'main/src/test/java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java b/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java
index ef410412..e49982bf 100644
--- a/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java
+++ b/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java
@@ -32,6 +32,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.utils.resources.MessageConstants;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.pap.main.PapConstants;
import org.onap.policy.pap.main.PolicyPapException;
@@ -86,15 +87,14 @@ public class TestMain {
public void testMain_NoArguments() {
final String[] papConfigParameters = {};
assertThatThrownBy(() -> new Main(papConfigParameters)).isInstanceOf(PolicyPapRuntimeException.class)
- .hasMessage("start of policy pap service failed, used parameters are []");
+ .hasMessage(String.format(MessageConstants.START_FAILURE_MSG, MessageConstants.POLICY_PAP));
}
@Test
public void testMain_InvalidArguments() {
final String[] papConfigParameters = {"parameters/PapConfigParameters.json"};
assertThatThrownBy(() -> new Main(papConfigParameters)).isInstanceOf(PolicyPapRuntimeException.class)
- .hasMessage(
- "start of policy pap service failed, used parameters are [parameters/PapConfigParameters.json]");
+ .hasMessage(String.format(MessageConstants.START_FAILURE_MSG, MessageConstants.POLICY_PAP));
}
@Test
@@ -108,7 +108,6 @@ public class TestMain {
public void testMain_InvalidParameters() {
final String[] papConfigParameters = {"-c", "parameters/PapConfigParameters_InvalidName.json"};
assertThatThrownBy(() -> new Main(papConfigParameters)).isInstanceOf(PolicyPapRuntimeException.class)
- .hasMessage("start of policy pap service failed, "
- + "used parameters are [-c, parameters/PapConfigParameters_InvalidName.json]");
+ .hasMessage(String.format(MessageConstants.START_FAILURE_MSG, MessageConstants.POLICY_PAP));
}
}