summaryrefslogtreecommitdiffstats
path: root/common/src/test/java/org
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-09-11 12:58:16 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-11 12:58:16 +0000
commit6164166521c11d2587b5a653e7cd146346e9e467 (patch)
tree3e4c90ba197948e9c5151a9dd7d27eec5e0f1fcf /common/src/test/java/org
parent862c7e03f4330d9ae8f9e73c912e74064294f9ce (diff)
parent193105ce3a95fb1682fef0a17c081c2e6ebb8ff5 (diff)
Merge "error message formatter now handles percent"
Diffstat (limited to 'common/src/test/java/org')
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIErrorFormatterTest.java16
1 files changed, 16 insertions, 0 deletions
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
@@ -79,6 +79,22 @@ public class AAIErrorFormatterTest {
}
@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);
AAIErrorFormatter formatter = new AAIErrorFormatter(errorObj);