From db5b469ca8698f7bf7110389de08b8233dfc7d6d Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Fri, 14 Aug 2020 16:49:40 +0100 Subject: Using standard success/failure messages in PAP Change-Id: If4613c0fc6f940bc82cf616aba2ba9cc03e1b599 Issue-ID: POLICY-2754 Signed-off-by: a.sreekumar --- .../test/java/org/onap/policy/pap/main/startstop/TestMain.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'main/src/test/java/org/onap') 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)); } } -- cgit 1.2.3-korg