aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/org/onap/so/exceptions/ValidationException.java10
-rw-r--r--common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java4
2 files changed, 7 insertions, 7 deletions
diff --git a/common/src/main/java/org/onap/so/exceptions/ValidationException.java b/common/src/main/java/org/onap/so/exceptions/ValidationException.java
index 713fac70f3..b91c30c598 100644
--- a/common/src/main/java/org/onap/so/exceptions/ValidationException.java
+++ b/common/src/main/java/org/onap/so/exceptions/ValidationException.java
@@ -32,9 +32,9 @@ public class ValidationException extends Exception {
private static final long serialVersionUID = 1L;
private static final String VALIDATION_FAIL = "No valid $ELEMENT is specified";
- private static final String INVALID_ELEMENT = "$ELEMENT is not valid in the $VERSION version";
+ private static final String UNMATCHED_ELEMENTS = "$ELEMENT does not match $SECOND_ELEMENT";
private static final String REPLACE_ELEMENT_KEY = "\\$ELEMENT";
- private static final String REPLACE_VERSION_KEY = "\\$VERSION";
+ private static final String REPLACE_SECOND_ELEMENT_KEY = "\\$SECOND_ELEMENT";
@Deprecated
public ValidationException (String msg) {
@@ -48,7 +48,7 @@ public class ValidationException extends Exception {
public ValidationException (String msg, Exception cause) {
super (VALIDATION_FAIL.replaceAll (REPLACE_ELEMENT_KEY, msg), cause);
}
- public ValidationException(String msg, String version) {
- super(INVALID_ELEMENT.replaceAll(REPLACE_ELEMENT_KEY, msg).replaceAll(REPLACE_VERSION_KEY, version));
+ public ValidationException(String firstElement, String secondElement) {
+ super(UNMATCHED_ELEMENTS.replaceAll(REPLACE_ELEMENT_KEY, firstElement).replaceAll(REPLACE_SECOND_ELEMENT_KEY, secondElement));
}
-}
+} \ No newline at end of file
diff --git a/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java b/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java
index b3ae7ba9f5..27fb584b3b 100644
--- a/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java
+++ b/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java
@@ -47,7 +47,7 @@ public class ValidationExceptionTest {
@Test
public void validationExceptionVersion(){
- ValidationException e = new ValidationException("testMessage", "1.0");
- Assert.assertEquals("testMessage is not valid in the 1.0 version", e.getMessage());
+ ValidationException e = new ValidationException("testMessage", "secondTestMessage");
+ Assert.assertEquals("testMessage does not match secondTestMessage", e.getMessage());
}
}