diff --git a/src/test/java/org/apache/commons/validator/VarTest.java b/src/test/java/org/apache/commons/validator/VarTest.java index 922c973ee..7f1e1e205 100644 --- a/src/test/java/org/apache/commons/validator/VarTest.java +++ b/src/test/java/org/apache/commons/validator/VarTest.java @@ -92,16 +92,16 @@ public void testVars() { assertEquals("value-2-1", var21.getValue(), "var-2-1 value is wrong"); assertEquals("jstype-2-1", var21.getJsType(), "var-2-1 jstype is wrong"); assertTrue(var21.isResource(), "var-2-1 resource is false"); - assertEquals(var21.getBundle(), "bundle-2-1", "var-2-1 bundle is wrong"); + assertEquals("bundle-2-1", var21.getBundle(), "var-2-1 bundle is wrong"); // Get var-2-2 final Var var22 = field2.getVar("var-2-2"); assertNotNull(var22, "var-2-2 is null."); - assertEquals(var22.getName(), "var-2-2", "var-2-2 name is wrong"); - assertEquals(var22.getValue(), "value-2-2", "var-2-2 value is wrong"); + assertEquals("var-2-2", var22.getName(), "var-2-2 name is wrong"); + assertEquals("value-2-2", var22.getValue(), "var-2-2 value is wrong"); assertNull(var22.getJsType(), "var-2-2 jstype is not null"); assertFalse(var22.isResource(), "var-2-2 resource is true"); - assertEquals(var22.getBundle(), "bundle-2-2", "var-2-2 bundle is wrong"); + assertEquals("bundle-2-2", var22.getBundle(), "var-2-2 bundle is wrong"); } diff --git a/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java index 71f9004cb..1275ce24c 100644 --- a/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java +++ b/src/test/java/org/apache/commons/validator/routines/RegexValidatorTest.java @@ -240,9 +240,9 @@ public void testSingle() { assertFalse(insensitive.isValid("ABd-de-1"), "Insensitive isValid() invalid"); // validate() - assertEquals(sensitive.validate("ac-DE-1"), "acDE1", "Sensitive validate() valid"); + assertEquals("acDE1", sensitive.validate("ac-DE-1"), "Sensitive validate() valid"); assertNull(sensitive.validate("AB-de-1"), "Sensitive validate() invalid"); - assertEquals(insensitive.validate("AB-de-1"), "ABde1", "Insensitive validate() valid"); + assertEquals("ABde1", insensitive.validate("AB-de-1"), "Insensitive validate() valid"); assertNull(insensitive.validate("ABd-de-1"), "Insensitive validate() invalid"); // match() @@ -250,7 +250,7 @@ public void testSingle() { checkArray("Sensitive match() invalid", null, sensitive.match("AB-de-1")); checkArray("Insensitive match() valid", new String[] { "AB", "de", "1" }, insensitive.match("AB-de-1")); checkArray("Insensitive match() invalid", null, insensitive.match("ABd-de-1")); - assertEquals(new RegexValidator("^([A-Z]*)$").validate("ABC"), "ABC", "validate one"); + assertEquals("ABC", new RegexValidator("^([A-Z]*)$").validate("ABC"), "validate one"); checkArray("match one", new String[] { "ABC" }, new RegexValidator("^([A-Z]*)$").match("ABC")); } @@ -260,10 +260,10 @@ public void testSingle() { @Test public void testToString() { final RegexValidator single = new RegexValidator(REGEX); - assertEquals(single.toString(), "RegexValidator{" + REGEX + "}", "Single"); + assertEquals("RegexValidator{" + REGEX + "}", single.toString(), "Single"); final RegexValidator multiple = new RegexValidator(REGEX, REGEX); - assertEquals(multiple.toString(), "RegexValidator{" + REGEX + "," + REGEX + "}", "Multiple"); + assertEquals("RegexValidator{" + REGEX + "," + REGEX + "}", multiple.toString(), "Multiple"); } } diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java index de954703a..998c505a1 100644 --- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java +++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISBNCheckDigitTest.java @@ -52,7 +52,7 @@ public void testInvalidLength() { assertFalse(routine.isValid("12345678901234"), "isValid() Lth 14"); Exception e = assertThrows(CheckDigitException.class, () -> routine.calculate("12345678"), "calculate() Lth 8"); - assertEquals(e.getMessage(), "Invalid ISBN Length = 8", "calculate() Lth 8"); + assertEquals("Invalid ISBN Length = 8", e.getMessage(), "calculate() Lth 8"); e = assertThrows(CheckDigitException.class, () -> routine.calculate("1234567890"), "calculate() Lth 10"); assertEquals("Invalid ISBN Length = 10", e.getMessage(), "calculate() Lth 10");