From 193105ce3a95fb1682fef0a17c081c2e6ebb8ff5 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max" Date: Tue, 10 Sep 2019 13:52:53 -0400 Subject: error message formatter now handles percent error message formatter now handles percent encoding Issue-ID: SO-2303 Signed-off-by: Benjamin, Max (mb388a) Change-Id: If4784ab54023b1df43eb7ee266a2797c9a12731b --- .../org/onap/so/client/aai/AAIErrorFormatterTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'common/src/test/java') diff --git a/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java b/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java index 2ef50dd77b..3587c71de0 100644 --- a/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java +++ b/common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java @@ -78,6 +78,22 @@ public class AAIErrorFormatterTest { assertEquals("equal", "test error message - service exception error test", result); } + @Test + public void errorMessageOnPercentEncodedTest() { + ServiceException svcException = new ServiceException(); + svcException.setText("test my%20Test %1 message - %2"); + svcException.setVariables(Arrays.asList("error", "service exception %1 test")); + + RequestError requestError = new RequestError(); + requestError.setServiceException(svcException); + + doReturn(requestError).when(errorObj).getRequestError(); + + AAIErrorFormatter formatter = new AAIErrorFormatter(errorObj); + String result = formatter.getMessage(); + assertEquals("equal", "test my%20Test error message - service exception error test", result); + } + @Test public void testGetMessageNoParsable() { errorObj.setRequestError(null); -- cgit 1.2.3-korg