You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2024/11/18 12:53:35 UTC
(commons-validator) 08/11: Removed unnecessary lambdas in the tests
This is an automated email from the ASF dual-hosted git repository.
ebourg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git
commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
Author: Emmanuel Bourg <eb...@apache.org>
AuthorDate: Mon Nov 18 11:22:35 2024 +0100
Removed unnecessary lambdas in the tests
---
.../commons/validator/AbstractNumberTest.java | 6 ++--
.../org/apache/commons/validator/DateTest.java | 6 ++--
.../org/apache/commons/validator/EmailTest.java | 6 ++--
.../validator/GenericTypeValidatorTest.java | 16 ++++-----
.../org/apache/commons/validator/MultipleTest.java | 20 +++++------
.../apache/commons/validator/ParameterTest.java | 4 +--
.../apache/commons/validator/RequiredIfTest.java | 36 +++++++++----------
.../apache/commons/validator/RequiredNameTest.java | 40 +++++++++++-----------
.../commons/validator/ValidatorResultsTest.java | 10 +++---
.../routines/AbstractNumberValidatorTest.java | 16 ++++-----
.../routines/InetAddressValidatorTest.java | 4 +--
.../validator/routines/TimeValidatorTest.java | 20 +++++------
.../routines/checkdigit/CUSIPCheckDigitTest.java | 4 +--
.../routines/checkdigit/ISINCheckDigitTest.java | 2 +-
.../checkdigit/ModulusTenCUSIPCheckDigitTest.java | 4 +--
.../checkdigit/ModulusTenSedolCheckDigitTest.java | 2 +-
.../routines/checkdigit/SedolCheckDigitTest.java | 2 +-
17 files changed, 99 insertions(+), 99 deletions(-)
diff --git a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
index b245c536..6652428e 100644
--- a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
+++ b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
@@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends AbstractCommonTest {
final ValidatorResult result = results.getValidatorResult("value");
- assertNotNull(result, () -> action + " value ValidatorResult should not be null.");
- assertTrue(result.containsAction(action), () -> action + " value ValidatorResult should contain the '" + action + "' action.");
+ assertNotNull(result, action + " value ValidatorResult should not be null.");
+ assertTrue(result.containsAction(action), action + " value ValidatorResult should contain the '" + action + "' action.");
assertTrue(passed ? result.isValid(action) : !result.isValid(action),
- () -> action + " value ValidatorResult for the '" + action + "' action should have " + (passed ? "passed" : "failed") + ".");
+ action + " value ValidatorResult for the '" + action + "' action should have " + (passed ? "passed" : "failed") + ".");
}
}
diff --git a/src/test/java/org/apache/commons/validator/DateTest.java b/src/test/java/org/apache/commons/validator/DateTest.java
index c7db41d4..a42d6b4c 100644
--- a/src/test/java/org/apache/commons/validator/DateTest.java
+++ b/src/test/java/org/apache/commons/validator/DateTest.java
@@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
final ValidatorResult result = results.getValidatorResult("value");
- assertNotNull(result, () -> ACTION + " value ValidatorResult should not be null.");
- assertTrue(result.containsAction(ACTION), () -> ACTION + " value ValidatorResult should contain the '" + ACTION + "' action.");
+ assertNotNull(result, ACTION + " value ValidatorResult should not be null.");
+ assertTrue(result.containsAction(ACTION), ACTION + " value ValidatorResult should contain the '" + ACTION + "' action.");
assertTrue(passed ? result.isValid(ACTION) : !result.isValid(ACTION),
- () -> ACTION + " value ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
+ ACTION + " value ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
}
}
diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java b/src/test/java/org/apache/commons/validator/EmailTest.java
index 39a78230..92ae84ce 100644
--- a/src/test/java/org/apache/commons/validator/EmailTest.java
+++ b/src/test/java/org/apache/commons/validator/EmailTest.java
@@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
final ValidatorResult result = results.getValidatorResult("value");
- assertNotNull(result, () -> ACTION + " value ValidatorResult should not be null.");
- assertTrue(result.containsAction(ACTION), () -> "Value " + info.getValue() + " ValidatorResult should contain the '" + ACTION + "' action.");
+ assertNotNull(result, ACTION + " value ValidatorResult should not be null.");
+ assertTrue(result.containsAction(ACTION), "Value " + info.getValue() + " ValidatorResult should contain the '" + ACTION + "' action.");
assertTrue(passed ? result.isValid(ACTION) : !result.isValid(ACTION),
- () -> "Value " + info.getValue() + "ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
+ "Value " + info.getValue() + "ValidatorResult for the '" + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
}
}
diff --git a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
index 104bfb4f..dd70d65f 100644
--- a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
@@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends AbstractCommonTest {
final Map<String, ?> hResultValues = results.getResultValueMap();
- assertInstanceOf(Byte.class, hResultValues.get("byte"), () -> "Expecting byte result to be an instance of Byte for locale: " + locale);
- assertInstanceOf(Short.class, hResultValues.get("short"), () -> "Expecting short result to be an instance of Short for locale: " + locale);
- assertInstanceOf(Integer.class, hResultValues.get("integer"), () -> "Expecting integer result to be an instance of Integer for locale: " + locale);
- assertInstanceOf(Long.class, hResultValues.get("long"), () -> "Expecting long result to be an instance of Long for locale: " + locale);
- assertInstanceOf(Float.class, hResultValues.get("float"), () -> "Expecting float result to be an instance of Float for locale: " + locale);
- assertInstanceOf(Double.class, hResultValues.get("double"), () -> "Expecting double result to be an instance of Double for locale: " + locale);
- assertInstanceOf(Date.class, hResultValues.get("date"), () -> "Expecting date result to be an instance of Date for locale: " + locale);
+ assertInstanceOf(Byte.class, hResultValues.get("byte"), "Expecting byte result to be an instance of Byte for locale: " + locale);
+ assertInstanceOf(Short.class, hResultValues.get("short"), "Expecting short result to be an instance of Short for locale: " + locale);
+ assertInstanceOf(Integer.class, hResultValues.get("integer"), "Expecting integer result to be an instance of Integer for locale: " + locale);
+ assertInstanceOf(Long.class, hResultValues.get("long"), "Expecting long result to be an instance of Long for locale: " + locale);
+ assertInstanceOf(Float.class, hResultValues.get("float"), "Expecting float result to be an instance of Float for locale: " + locale);
+ assertInstanceOf(Double.class, hResultValues.get("double"), "Expecting double result to be an instance of Double for locale: " + locale);
+ assertInstanceOf(Date.class, hResultValues.get("date"), "Expecting date result to be an instance of Date for locale: " + locale);
for (final String key : hResultValues.keySet()) {
final Object value = hResultValues.get(key);
- assertNotNull(value, () -> "value ValidatorResults.getResultValueMap() should not be null for locale: " + locale);
+ assertNotNull(value, "value ValidatorResults.getResultValueMap() should not be null for locale: " + locale);
}
return hResultValues;
}
diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java b/src/test/java/org/apache/commons/validator/MultipleTest.java
index 5e9cfa04..e20cedea 100644
--- a/src/test/java/org/apache/commons/validator/MultipleTest.java
+++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
@@ -83,12 +83,12 @@ public class MultipleTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertFalse(lastNameResult.containsAction("int"), "Last Name ValidatorResults should not contain the 'int' action.");
}
@@ -262,8 +262,8 @@ public class MultipleTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
@@ -296,8 +296,8 @@ public class MultipleTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
@@ -330,8 +330,8 @@ public class MultipleTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
assertTrue(lastNameResult.containsAction("int"), "Last Name ValidatorResult should contain the 'int' action.");
diff --git a/src/test/java/org/apache/commons/validator/ParameterTest.java b/src/test/java/org/apache/commons/validator/ParameterTest.java
index 629c06e7..c254d160 100644
--- a/src/test/java/org/apache/commons/validator/ParameterTest.java
+++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
@@ -43,8 +43,8 @@ public class ParameterTest extends AbstractCommonTest {
private void assertParameterValue(final Validator validator, final String name, final Class<?> type) {
final Object value = validator.getParameterValue(name);
- assertNotNull(value, () -> "Expected '" + type.getName() + "' but was null");
- assertTrue(type.isInstance(value), () -> "Expected '" + type.getName() + "' but was '" + value.getClass().getName() + "'");
+ assertNotNull(value, "Expected '" + type.getName() + "' but was null");
+ assertTrue(type.isInstance(value), "Expected '" + type.getName() + "' but was '" + value.getClass().getName() + "'");
}
/**
diff --git a/src/test/java/org/apache/commons/validator/RequiredIfTest.java b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
index 699db985..95324a37 100644
--- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
+++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
@@ -83,12 +83,12 @@ public class RequiredIfTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
}
/**
@@ -117,12 +117,12 @@ public class RequiredIfTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
}
/**
@@ -151,12 +151,12 @@ public class RequiredIfTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
}
/**
@@ -189,8 +189,8 @@ public class RequiredIfTest extends AbstractCommonTest {
assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
}
@@ -220,12 +220,12 @@ public class RequiredIfTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "Last Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
}
}
diff --git a/src/test/java/org/apache/commons/validator/RequiredNameTest.java b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
index 6578e360..05689158 100644
--- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
+++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
@@ -83,8 +83,8 @@ public class RequiredNameTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
@@ -116,12 +116,12 @@ public class RequiredNameTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
}
/**
@@ -149,12 +149,12 @@ public class RequiredNameTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
}
/**
@@ -182,12 +182,12 @@ public class RequiredNameTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
}
@@ -220,8 +220,8 @@ public class RequiredNameTest extends AbstractCommonTest {
assertFalse(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have failed.");
assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertFalse(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have failed.");
}
/**
@@ -250,12 +250,12 @@ public class RequiredNameTest extends AbstractCommonTest {
final ValidatorResult lastNameResult = results.getValidatorResult("lastName");
assertNotNull(firstNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(firstNameResult.containsAction(ACTION), () -> "First Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(firstNameResult.isValid(ACTION), () -> "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(firstNameResult.containsAction(ACTION), "First Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(firstNameResult.isValid(ACTION), "First Name ValidatorResult for the '" + ACTION + "' action should have passed.");
assertNotNull(lastNameResult, "First Name ValidatorResult should not be null.");
- assertTrue(lastNameResult.containsAction(ACTION), () -> "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
- assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
+ assertTrue(lastNameResult.containsAction(ACTION), "Last Name ValidatorResult should contain the '" + ACTION + "' action.");
+ assertTrue(lastNameResult.isValid(ACTION), "Last Name ValidatorResult for the '" + ACTION + "' action should have passed.");
}
}
\ No newline at end of file
diff --git a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
index b956d071..54a8f5fb 100644
--- a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
+++ b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
@@ -47,8 +47,8 @@ public class ValidatorResultsTest extends AbstractCommonTest {
*/
private void checkNotRun(final ValidatorResults results, final String field, final String action) {
final ValidatorResult result = results.getValidatorResult(field);
- assertNotNull(result, () -> field + " result");
- assertFalse(result.containsAction(action), () -> field + "[" + action + "] run");
+ assertNotNull(result, field + " result");
+ assertFalse(result.containsAction(action), field + "[" + action + "] run");
// System.out.println(field + "[" + action + "] not run");
}
@@ -58,9 +58,9 @@ public class ValidatorResultsTest extends AbstractCommonTest {
private void checkValidatorResult(final ValidatorResults results, final String field, final String action, final boolean expected) {
final ValidatorResult result = results.getValidatorResult(field);
// System.out.println(field + "[" + action + "]=" + result.isValid(action));
- assertNotNull(result, () -> field + " result");
- assertTrue(result.containsAction(action), () -> field + "[" + action + "] not run");
- assertEquals(expected, result.isValid(action), () -> field + "[" + action + "] result");
+ assertNotNull(result, field + " result");
+ assertTrue(result.containsAction(action), field + "[" + action + "] not run");
+ assertEquals(expected, result.isValid(action), field + "[" + action + "] result");
}
/**
diff --git a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
index a9847cf8..66849f25 100644
--- a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
@@ -107,10 +107,10 @@ public abstract class AbstractNumberValidatorTest {
public void testInvalidNotStrict() {
for (int i = 0; i < invalid.length; i++) {
final String text = "idx=[" + i + "] value=[" + invalid[i] + "]";
- assertNull(validator.parse(invalid[i], null, Locale.US), () -> "(A) " + text);
- assertFalse(validator.isValid(invalid[i], null, Locale.US), () -> "(B) " + text);
- assertNull(validator.parse(invalid[i], testPattern, null), () -> "(C) " + text);
- assertFalse(validator.isValid(invalid[i], testPattern, null), () -> "(D) " + text);
+ assertNull(validator.parse(invalid[i], null, Locale.US), "(A) " + text);
+ assertFalse(validator.isValid(invalid[i], null, Locale.US), "(B) " + text);
+ assertNull(validator.parse(invalid[i], testPattern, null), "(C) " + text);
+ assertFalse(validator.isValid(invalid[i], testPattern, null), "(D) " + text);
}
}
@@ -121,10 +121,10 @@ public abstract class AbstractNumberValidatorTest {
public void testInvalidStrict() {
for (int i = 0; i < invalidStrict.length; i++) {
final String text = "idx=[" + i + "] value=[" + invalidStrict[i] + "]";
- assertNull(strictValidator.parse(invalidStrict[i], null, Locale.US), () -> "(A) " + text);
- assertFalse(strictValidator.isValid(invalidStrict[i], null, Locale.US), () -> "(B) " + text);
- assertNull(strictValidator.parse(invalidStrict[i], testPattern, null), () -> "(C) " + text);
- assertFalse(strictValidator.isValid(invalidStrict[i], testPattern, null), () -> "(D) " + text);
+ assertNull(strictValidator.parse(invalidStrict[i], null, Locale.US), "(A) " + text);
+ assertFalse(strictValidator.isValid(invalidStrict[i], null, Locale.US), "(B) " + text);
+ assertNull(strictValidator.parse(invalidStrict[i], testPattern, null), "(C) " + text);
+ assertFalse(strictValidator.isValid(invalidStrict[i], testPattern, null), "(D) " + text);
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
index 49971f2e..8566dde0 100644
--- a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
@@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
"2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh", // '%' in node id
};
for (final String item : valid) {
- assertTrue(validator.isValid(item), () -> String.format("%s should be valid", item));
+ assertTrue(validator.isValid(item), String.format("%s should be valid", item));
}
for (final String item : invalid) {
- assertFalse(validator.isValid(item), () -> String.format("%s should be invalid", item));
+ assertFalse(validator.isValid(item), String.format("%s should be invalid", item));
}
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
index 72747901..bbeca924 100644
--- a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
@@ -198,8 +198,8 @@ public class TimeValidatorTest {
for (int i = 0; i < localeInvalid.length; i++) {
final String text = i + " value=[" + localeInvalid[i] + "] passed ";
final Object date = validator.validate(localeInvalid[i], Locale.US);
- assertNull(date, () -> "validate() " + text + date);
- assertFalse(validator.isValid(localeInvalid[i], Locale.UK), () -> "isValid() " + text);
+ assertNull(date, "validate() " + text + date);
+ assertFalse(validator.isValid(localeInvalid[i], Locale.UK), "isValid() " + text);
}
}
@@ -211,10 +211,10 @@ public class TimeValidatorTest {
for (int i = 0; i < localeValid.length; i++) {
final String text = i + " value=[" + localeValid[i] + "] failed ";
final Calendar calendar = validator.validate(localeValid[i], Locale.UK);
- assertNotNull(calendar, () -> "validate() " + text);
+ assertNotNull(calendar, "validate() " + text);
final Date date = calendar.getTime();
- assertTrue(validator.isValid(localeValid[i], Locale.UK), () -> "isValid() " + text);
- assertEquals(localeExpect[i], date, () -> "compare " + text);
+ assertTrue(validator.isValid(localeValid[i], Locale.UK), "isValid() " + text);
+ assertEquals(localeExpect[i], date, "compare " + text);
}
}
@@ -226,8 +226,8 @@ public class TimeValidatorTest {
for (int i = 0; i < patternInvalid.length; i++) {
final String text = i + " value=[" + patternInvalid[i] + "] passed ";
final Object date = validator.validate(patternInvalid[i], "HH-mm-ss");
- assertNull(date, () -> "validate() " + text + date);
- assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"), () -> "isValid() " + text);
+ assertNull(date, "validate() " + text + date);
+ assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"), "isValid() " + text);
}
}
@@ -239,10 +239,10 @@ public class TimeValidatorTest {
for (int i = 0; i < patternValid.length; i++) {
final String text = i + " value=[" + patternValid[i] + "] failed ";
final Calendar calendar = validator.validate(patternValid[i], "HH-mm-ss");
- assertNotNull(calendar, () -> "validateObj() " + text);
+ assertNotNull(calendar, "validateObj() " + text);
final Date date = calendar.getTime();
- assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"), () -> "isValid() " + text);
- assertEquals(patternExpect[i], date, () -> "compare " + text);
+ assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"), "isValid() " + text);
+ assertEquals(patternExpect[i], date, "compare " + text);
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
index 69136900..fb5df1f2 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
@@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends AbstractCheckDigitTest {
@Test
public void testValidator336InvalidCheckDigits() {
for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
- assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+ assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
}
}
@Test
public void testValidator336ValidCheckDigits() {
for (final String validCheckDigit : VALID_CHECK_DIGITS) {
- assertTrue(routine.isValid(validCheckDigit), () -> "Should fail: " + validCheckDigit);
+ assertTrue(routine.isValid(validCheckDigit), "Should fail: " + validCheckDigit);
}
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
index f84ec5ce..62b9cb25 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
@@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends AbstractCheckDigitTest {
@Test
public void testValidator345() {
for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
- assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+ assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
}
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
index 1217ef90..8dd23b9a 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
@@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends AbstractCheckDigitTest {
@Test
public void testValidator336InvalidCheckDigits() {
for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
- assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+ assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
}
}
@Test
public void testValidator336ValidCheckDigits() {
for (final String validCheckDigit : VALID_CHECK_DIGITS) {
- assertTrue(routine.isValid(validCheckDigit), () -> "Should fail: " + validCheckDigit);
+ assertTrue(routine.isValid(validCheckDigit), "Should fail: " + validCheckDigit);
}
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
index 90d03eb0..12458a83 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
@@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends AbstractCheckDigitTest {
@Test
public void testValidator346() {
for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
- assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+ assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
}
}
diff --git a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
index 47017a36..43712ed6 100644
--- a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
@@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends AbstractCheckDigitTest {
@Test
public void testValidator346() {
for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
- assertFalse(routine.isValid(invalidCheckDigit), () -> "Should fail: " + invalidCheckDigit);
+ assertFalse(routine.isValid(invalidCheckDigit), "Should fail: " + invalidCheckDigit);
}
}
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 19/11/2024 à 19:12, Emmanuel Bourg a écrit :
> I ran "mvn clean" and "mvn package" 20 times, ignoring the first 10 runs
> to warm up the system caches, and noted the total build time reported by
> Maven. The build machine is a 6 years old laptop (Core i6 7500U, 32GB
> RAM) on Windows 10, using Java 8:
>
> At commit 7eee2066, before the lambda change, I get:
> Average: 38,788s ±601ms
>
>
> At commit dfd4a9e4, on the commit removing the lambdas, I get:
> Average: 38,132s ±660ms (1.7% improvement)
>
>
> At commit cdc0125b, after all my changes, I get:
> Average: 37,820s ±745 (2,5% improvement)
>
>
> I didn't expect such a noticeable difference but it looks like the build
> time actually improved.
I ran another set of tests on a faster machine. Here is the setup:
- Xeon E-2274G 4C/8T @ 4GHz, 64GB RAM
- Debian Sid
- OpenJDK 8 and 21
- Maven 3.8.8
- 100 runs per test
- "mvn compile test" only, no "package" goal
- "mvn clean" between runs, not measured
- animal-sniffer, jacoco and buildnumber plugins disabled
- first build at commit 7eee2066 before the change
- second build at commit dfd4a9e4 (lambda removal) + 8047556
(String.format() removal)
Here are the results:
OpenJDK 8 OpenJDK 21
Before 8.030s ±345ms (±4.30%) 8.089s ±217ms (±2.68%)
After 7.940s ±320ms (±4.03%) 8.016s ±183ms (±2.28%)
Difference -90ms (-1.12%) -73ms (-0.91%)
So here again, it's slightly faster without lambdas.
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 19/11/2024 à 18:10, Emmanuel Bourg a écrit :
> If you can prove your claim by demonstrating that this readability
> improvement degrades the build time of Commons Validator by more than
> 0.01% I'll happily revert it.
Since I was asked privately in undiplomatic terms to do it myself, I'm
sharing my results.
I ran "mvn clean" and "mvn package" 20 times, ignoring the first 10 runs
to warm up the system caches, and noted the total build time reported by
Maven. The build machine is a 6 years old laptop (Core i6 7500U, 32GB
RAM) on Windows 10, using Java 8:
At commit 7eee2066, before the lambda change, I get:
38,329
39,184
38,875
37,826
38,887
39,952
38,313
38,434
39,277
38,802
Average: 38,788s ±601ms
At commit dfd4a9e4, on the commit removing the lambdas, I get:
37,182
38,614
37,486
38,777
38,242
37,486
38,464
37,436
38,825
38,805
Average: 38,132s ±660ms (1.7% improvement)
At commit cdc0125b, after all my changes, I get:
37,627
38,015
38,236
37,043
38,691
36,404
38,377
37,396
38,751
37,663
Average: 37,820s ±745 (2,5% improvement)
I didn't expect such a noticeable difference but it looks like the build
time actually improved.
Talking about build time, there are some plugins executed in the
compile/test phases (rat, buildnumber, animal-sniffer) that could be
moved to the package or install phases, or to the release profile to
save some time when developing.
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 18/11/2024 à 17:11, Gary Gregory a écrit :
> -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
> avoid construction of failure message strings, which, as a pattern, add
> processing, can have side effects, and always creates more garbage. This is
> bad since in general toString() methods can do anything. String.format() is
> a great way to create nice messages in a compact way but is not free.
(reposting since the reply was mistakenly sent to Gary instead of the
mailing list)
The JUnit 5 documentation [1] states:
"When using a Supplier<String> (e.g., a lambda expression), the message
is evaluated lazily. This can provide a performance benefit, especially
if message construction is complex or time-consuming, as it is only
evaluated when the assertion fails."
Simple string concatenations are neither complex nor time-consuming.
It's nowhere mentioned that the direct value construct is deprecated or
discouraged.
If you can prove your claim by demonstrating that this readability
improvement degrades the build time of Commons Validator by more than
0.01% I'll happily revert it.
Emmanuel Bourg
[1] https://junit.org/junit5/docs/snapshot/user-guide/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Gary Gregory <ga...@gmail.com>.
Please, definitely not assert-j or hamcrest. I'd rather stay with the
current mess.
I've actually spent time replacing assert-j with JUnit calls because Java
is verbose enough without this type of code. JUnit has the right balance
and approach IMO. I've seen code using assertj that is silly when all you
need is assertEquals().
Junit-pioneer OTOH is a fantastic library. Actually useful.
Gary
On Tue, Nov 19, 2024, 4:27 PM Piotr P. Karwasz <pi...@mailing.copernik.eu>
wrote:
> Hi Gary,
>
> On 18.11.2024 17:11, Gary Gregory wrote:
> > -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> > mistake imo, please stop, these JUnit APIs exist for a reason: The
> lambdas
> > avoid construction of failure message strings, which, as a pattern, add
> > processing, can have side effects, and always creates more garbage. This
> is
> > bad since in general toString() methods can do anything. String.format()
> is
> > a great way to create nice messages in a compact way but is not free.
> >
> > Gary
> >
> > On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
> >
> >> - assertNotNull(result, () -> action + " value ValidatorResult
> >> should not be null.");
> >> - assertTrue(result.containsAction(action), () -> action + "
> value
> >> ValidatorResult should contain the '" + action + "' action.");
> >> + assertNotNull(result, action + " value ValidatorResult should
> not
> >> be null.");
> >> + assertTrue(result.containsAction(action), action + " value
> >> ValidatorResult should contain the '" + action + "' action.");
> >> assertTrue(passed ? result.isValid(action) :
> >> !result.isValid(action),
> >
> As a compromise we could switch to AssertJ, which has parameterized
> descriptions and more readable:
>
> assertThat(result).as("ValidatorResult for %s", action).isNotNull();
>
> Piotr
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 19/11/2024 à 22:26, Piotr P. Karwasz a écrit :
> As a compromise we could switch to AssertJ, which has parameterized
> descriptions and more readable:
>
> assertThat(result).as("ValidatorResult for %s", action).isNotNull();
>
Nice fluent syntax, but let's not waste more time on this futile debate.
I don't care that much about the syntax of the assertions, I was just
clearing some IDE warnings when I removed the lambdas. I don't mind if
Gary reverts the commit if he feels better that way, this has zero
impact on the users anyway.
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by "Piotr P. Karwasz" <pi...@mailing.copernik.eu>.
Hi Gary,
On 18.11.2024 17:11, Gary Gregory wrote:
> -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
> avoid construction of failure message strings, which, as a pattern, add
> processing, can have side effects, and always creates more garbage. This is
> bad since in general toString() methods can do anything. String.format() is
> a great way to create nice messages in a compact way but is not free.
>
> Gary
>
> On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
>
>> - assertNotNull(result, () -> action + " value ValidatorResult
>> should not be null.");
>> - assertTrue(result.containsAction(action), () -> action + " value
>> ValidatorResult should contain the '" + action + "' action.");
>> + assertNotNull(result, action + " value ValidatorResult should not
>> be null.");
>> + assertTrue(result.containsAction(action), action + " value
>> ValidatorResult should contain the '" + action + "' action.");
>> assertTrue(passed ? result.isValid(action) :
>> !result.isValid(action),
>
As a compromise we could switch to AssertJ, which has parameterized
descriptions and more readable:
assertThat(result).as("ValidatorResult for %s", action).isNotNull();
Piotr
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Gary Gregory <ga...@gmail.com>.
On Mon, Nov 18, 2024, 11:16 AM Mike Drob <md...@mdrob.com> wrote:
> In practical terms, what is the time cost?
I am thinking in terms of the cumulative costs of running build after build
on CI systems on many Java versions and sometimes many OSs. What also
matters is showing best practices on JUnit 5 to contractors and
maintainers. This isn't it IMO. YMMV on readability. I prefer to see that a
contributor cares about details and thinks of the big picture than quick
hacks to satisfy personal preferences.
Gary
I imagined the lambda APIs
> existing to avoid heavy processing, like printing out the state of a
> database or other large complex graph. StringBuilder doesn't seem like a
> huge issue and the readability is nice. Have we spent more time writing
> these emails than would be saved over the lifetime of every developer who
> ever runs the tests?
>
> On Mon, Nov 18, 2024 at 10:12 AM Gary Gregory <ga...@gmail.com>
> wrote:
>
> > -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> > mistake imo, please stop, these JUnit APIs exist for a reason: The
> lambdas
> > avoid construction of failure message strings, which, as a pattern, add
> > processing, can have side effects, and always creates more garbage. This
> is
> > bad since in general toString() methods can do anything. String.format()
> is
> > a great way to create nice messages in a compact way but is not free.
> >
> > Gary
> >
> > On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
> >
> > > This is an automated email from the ASF dual-hosted git repository.
> > >
> > > ebourg pushed a commit to branch master
> > > in repository
> https://gitbox.apache.org/repos/asf/commons-validator.git
> > >
> > > commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
> > > Author: Emmanuel Bourg <eb...@apache.org>
> > > AuthorDate: Mon Nov 18 11:22:35 2024 +0100
> > >
> > > Removed unnecessary lambdas in the tests
> > > ---
> > > .../commons/validator/AbstractNumberTest.java | 6 ++--
> > > .../org/apache/commons/validator/DateTest.java | 6 ++--
> > > .../org/apache/commons/validator/EmailTest.java | 6 ++--
> > > .../validator/GenericTypeValidatorTest.java | 16 ++++-----
> > > .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
> > > .../apache/commons/validator/ParameterTest.java | 4 +--
> > > .../apache/commons/validator/RequiredIfTest.java | 36
> > > +++++++++----------
> > > .../apache/commons/validator/RequiredNameTest.java | 40
> > > +++++++++++-----------
> > > .../commons/validator/ValidatorResultsTest.java | 10 +++---
> > > .../routines/AbstractNumberValidatorTest.java | 16 ++++-----
> > > .../routines/InetAddressValidatorTest.java | 4 +--
> > > .../validator/routines/TimeValidatorTest.java | 20 +++++------
> > > .../routines/checkdigit/CUSIPCheckDigitTest.java | 4 +--
> > > .../routines/checkdigit/ISINCheckDigitTest.java | 2 +-
> > > .../checkdigit/ModulusTenCUSIPCheckDigitTest.java | 4 +--
> > > .../checkdigit/ModulusTenSedolCheckDigitTest.java | 2 +-
> > > .../routines/checkdigit/SedolCheckDigitTest.java | 2 +-
> > > 17 files changed, 99 insertions(+), 99 deletions(-)
> > >
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > index b245c536..6652428e 100644
> > > ---
> a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > +++
> b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > > @@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends
> > > AbstractCommonTest {
> > >
> > > final ValidatorResult result =
> > > results.getValidatorResult("value");
> > >
> > > - assertNotNull(result, () -> action + " value ValidatorResult
> > > should not be null.");
> > > - assertTrue(result.containsAction(action), () -> action + "
> value
> > > ValidatorResult should contain the '" + action + "' action.");
> > > + assertNotNull(result, action + " value ValidatorResult should
> > not
> > > be null.");
> > > + assertTrue(result.containsAction(action), action + " value
> > > ValidatorResult should contain the '" + action + "' action.");
> > > assertTrue(passed ? result.isValid(action) :
> > > !result.isValid(action),
> > > - () -> action + " value ValidatorResult for the '" +
> > > action + "' action should have " + (passed ? "passed" : "failed") +
> ".");
> > > + action + " value ValidatorResult for the '" + action +
> > "'
> > > action should have " + (passed ? "passed" : "failed") + ".");
> > > }
> > >
> > > }
> > > diff --git a/src/test/java/org/apache/commons/validator/DateTest.java
> > > b/src/test/java/org/apache/commons/validator/DateTest.java
> > > index c7db41d4..a42d6b4c 100644
> > > --- a/src/test/java/org/apache/commons/validator/DateTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/DateTest.java
> > > @@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
> > >
> > > final ValidatorResult result =
> > > results.getValidatorResult("value");
> > >
> > > - assertNotNull(result, () -> ACTION + " value ValidatorResult
> > > should not be null.");
> > > - assertTrue(result.containsAction(ACTION), () -> ACTION + "
> value
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertNotNull(result, ACTION + " value ValidatorResult should
> > not
> > > be null.");
> > > + assertTrue(result.containsAction(ACTION), ACTION + " value
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > assertTrue(passed ? result.isValid(ACTION) :
> > > !result.isValid(ACTION),
> > > - () -> ACTION + " value ValidatorResult for the '" +
> > > ACTION + "' action should have " + (passed ? "passed" : "failed") +
> ".");
> > > + ACTION + " value ValidatorResult for the '" + ACTION +
> > "'
> > > action should have " + (passed ? "passed" : "failed") + ".");
> > > }
> > >
> > > }
> > > diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java
> > > b/src/test/java/org/apache/commons/validator/EmailTest.java
> > > index 39a78230..92ae84ce 100644
> > > --- a/src/test/java/org/apache/commons/validator/EmailTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/EmailTest.java
> > > @@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
> > >
> > > final ValidatorResult result =
> > > results.getValidatorResult("value");
> > >
> > > - assertNotNull(result, () -> ACTION + " value ValidatorResult
> > > should not be null.");
> > > - assertTrue(result.containsAction(ACTION), () -> "Value " +
> > > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > > action.");
> > > + assertNotNull(result, ACTION + " value ValidatorResult should
> > not
> > > be null.");
> > > + assertTrue(result.containsAction(ACTION), "Value " +
> > > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > > action.");
> > > assertTrue(passed ? result.isValid(ACTION) :
> > > !result.isValid(ACTION),
> > > - () -> "Value " + info.getValue() + "ValidatorResult
> for
> > > the '" + ACTION + "' action should have " + (passed ? "passed" :
> > "failed")
> > > + ".");
> > > + "Value " + info.getValue() + "ValidatorResult for the
> '"
> > > + ACTION + "' action should have " + (passed ? "passed" : "failed") +
> > ".");
> > > }
> > > }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > > index 104bfb4f..dd70d65f 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > > @@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends
> > > AbstractCommonTest {
> > >
> > > final Map<String, ?> hResultValues =
> > results.getResultValueMap();
> > >
> > > - assertInstanceOf(Byte.class, hResultValues.get("byte"), () ->
> > > "Expecting byte result to be an instance of Byte for locale: " +
> locale);
> > > - assertInstanceOf(Short.class, hResultValues.get("short"), ()
> ->
> > > "Expecting short result to be an instance of Short for locale: " +
> > locale);
> > > - assertInstanceOf(Integer.class, hResultValues.get("integer"),
> ()
> > > -> "Expecting integer result to be an instance of Integer for locale:
> " +
> > > locale);
> > > - assertInstanceOf(Long.class, hResultValues.get("long"), () ->
> > > "Expecting long result to be an instance of Long for locale: " +
> locale);
> > > - assertInstanceOf(Float.class, hResultValues.get("float"), ()
> ->
> > > "Expecting float result to be an instance of Float for locale: " +
> > locale);
> > > - assertInstanceOf(Double.class, hResultValues.get("double"), ()
> > ->
> > > "Expecting double result to be an instance of Double for locale: " +
> > > locale);
> > > - assertInstanceOf(Date.class, hResultValues.get("date"), () ->
> > > "Expecting date result to be an instance of Date for locale: " +
> locale);
> > > + assertInstanceOf(Byte.class, hResultValues.get("byte"),
> > > "Expecting byte result to be an instance of Byte for locale: " +
> locale);
> > > + assertInstanceOf(Short.class, hResultValues.get("short"),
> > > "Expecting short result to be an instance of Short for locale: " +
> > locale);
> > > + assertInstanceOf(Integer.class, hResultValues.get("integer"),
> > > "Expecting integer result to be an instance of Integer for locale: " +
> > > locale);
> > > + assertInstanceOf(Long.class, hResultValues.get("long"),
> > > "Expecting long result to be an instance of Long for locale: " +
> locale);
> > > + assertInstanceOf(Float.class, hResultValues.get("float"),
> > > "Expecting float result to be an instance of Float for locale: " +
> > locale);
> > > + assertInstanceOf(Double.class, hResultValues.get("double"),
> > > "Expecting double result to be an instance of Double for locale: " +
> > > locale);
> > > + assertInstanceOf(Date.class, hResultValues.get("date"),
> > > "Expecting date result to be an instance of Date for locale: " +
> locale);
> > >
> > > for (final String key : hResultValues.keySet()) {
> > > final Object value = hResultValues.get(key);
> > >
> > > - assertNotNull(value, () -> "value
> > > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > > locale);
> > > + assertNotNull(value, "value
> > > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > > locale);
> > > }
> > > return hResultValues;
> > > }
> > > diff --git
> a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > index 5e9cfa04..e20cedea 100644
> > > --- a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > > @@ -83,12 +83,12 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > assertFalse(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResults should not contain the 'int' action.");
> > > }
> > >
> > > @@ -262,8 +262,8 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > assertTrue(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResult should contain the 'int' action.");
> > > @@ -296,8 +296,8 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > assertTrue(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResult should contain the 'int' action.");
> > > @@ -330,8 +330,8 @@ public class MultipleTest extends
> AbstractCommonTest
> > {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > assertTrue(lastNameResult.containsAction("int"), "Last Name
> > > ValidatorResult should contain the 'int' action.");
> > > diff --git
> > a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > index 629c06e7..c254d160 100644
> > > --- a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > > @@ -43,8 +43,8 @@ public class ParameterTest extends
> AbstractCommonTest {
> > >
> > > private void assertParameterValue(final Validator validator, final
> > > String name, final Class<?> type) {
> > > final Object value = validator.getParameterValue(name);
> > > - assertNotNull(value, () -> "Expected '" + type.getName() + "'
> > but
> > > was null");
> > > - assertTrue(type.isInstance(value), () -> "Expected '" +
> > > type.getName() + "' but was '" + value.getClass().getName() + "'");
> > > + assertNotNull(value, "Expected '" + type.getName() + "' but
> was
> > > null");
> > > + assertTrue(type.isInstance(value), "Expected '" +
> type.getName()
> > > + "' but was '" + value.getClass().getName() + "'");
> > > }
> > >
> > > /**
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > index 699db985..95324a37 100644
> > > --- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > > @@ -83,12 +83,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest
> > > {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > }
> > >
> > > /**
> > > @@ -117,12 +117,12 @@ public class RequiredIfTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > }
> > >
> > > /**
> > > @@ -151,12 +151,12 @@ public class RequiredIfTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > }
> > >
> > > /**
> > > @@ -189,8 +189,8 @@ public class RequiredIfTest extends
> > AbstractCommonTest
> > > {
> > > assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > }
> > >
> > > @@ -220,12 +220,12 @@ public class RequiredIfTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "Last Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > }
> > >
> > > }
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > index 6578e360..05689158 100644
> > > --- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > +++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > > @@ -83,8 +83,8 @@ public class RequiredNameTest extends
> > AbstractCommonTest
> > > {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > @@ -116,12 +116,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > }
> > >
> > > /**
> > > @@ -149,12 +149,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > }
> > >
> > > /**
> > > @@ -182,12 +182,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > }
> > >
> > > @@ -220,8 +220,8 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > > assertFalse(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > >
> > > assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > > }
> > >
> > > /**
> > > @@ -250,12 +250,12 @@ public class RequiredNameTest extends
> > > AbstractCommonTest {
> > > final ValidatorResult lastNameResult =
> > > results.getValidatorResult("lastName");
> > >
> > > assertNotNull(firstNameResult, "First Name ValidatorResult
> > should
> > > not be null.");
> > > - assertTrue(firstNameResult.containsAction(ACTION), () ->
> "First
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > >
> > > assertNotNull(lastNameResult, "First Name ValidatorResult
> should
> > > not be null.");
> > > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > > ValidatorResult should contain the '" + ACTION + "' action.");
> > > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > > }
> > >
> > > }
> > > \ No newline at end of file
> > > diff --git
> > > a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > index b956d071..54a8f5fb 100644
> > > ---
> > a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > +++
> > b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > > @@ -47,8 +47,8 @@ public class ValidatorResultsTest extends
> > > AbstractCommonTest {
> > > */
> > > private void checkNotRun(final ValidatorResults results, final
> > String
> > > field, final String action) {
> > > final ValidatorResult result =
> > results.getValidatorResult(field);
> > > - assertNotNull(result, () -> field + " result");
> > > - assertFalse(result.containsAction(action), () -> field + "[" +
> > > action + "] run");
> > > + assertNotNull(result, field + " result");
> > > + assertFalse(result.containsAction(action), field + "[" +
> action
> > +
> > > "] run");
> > > // System.out.println(field + "[" + action + "] not run");
> > > }
> > >
> > > @@ -58,9 +58,9 @@ public class ValidatorResultsTest extends
> > > AbstractCommonTest {
> > > private void checkValidatorResult(final ValidatorResults results,
> > > final String field, final String action, final boolean expected) {
> > > final ValidatorResult result =
> > results.getValidatorResult(field);
> > > // System.out.println(field + "[" + action + "]=" +
> > > result.isValid(action));
> > > - assertNotNull(result, () -> field + " result");
> > > - assertTrue(result.containsAction(action), () -> field + "[" +
> > > action + "] not run");
> > > - assertEquals(expected, result.isValid(action), () -> field +
> "["
> > > + action + "] result");
> > > + assertNotNull(result, field + " result");
> > > + assertTrue(result.containsAction(action), field + "[" +
> action +
> > > "] not run");
> > > + assertEquals(expected, result.isValid(action), field + "[" +
> > > action + "] result");
> > > }
> > >
> > > /**
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > > index a9847cf8..66849f25 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > > @@ -107,10 +107,10 @@ public abstract class
> AbstractNumberValidatorTest {
> > > public void testInvalidNotStrict() {
> > > for (int i = 0; i < invalid.length; i++) {
> > > final String text = "idx=[" + i + "] value=[" +
> invalid[i] +
> > > "]";
> > > - assertNull(validator.parse(invalid[i], null, Locale.US),
> ()
> > > -> "(A) " + text);
> > > - assertFalse(validator.isValid(invalid[i], null,
> Locale.US),
> > > () -> "(B) " + text);
> > > - assertNull(validator.parse(invalid[i], testPattern, null),
> > ()
> > > -> "(C) " + text);
> > > - assertFalse(validator.isValid(invalid[i], testPattern,
> > null),
> > > () -> "(D) " + text);
> > > + assertNull(validator.parse(invalid[i], null, Locale.US),
> > "(A)
> > > " + text);
> > > + assertFalse(validator.isValid(invalid[i], null,
> Locale.US),
> > > "(B) " + text);
> > > + assertNull(validator.parse(invalid[i], testPattern, null),
> > > "(C) " + text);
> > > + assertFalse(validator.isValid(invalid[i], testPattern,
> > null),
> > > "(D) " + text);
> > > }
> > > }
> > >
> > > @@ -121,10 +121,10 @@ public abstract class
> AbstractNumberValidatorTest {
> > > public void testInvalidStrict() {
> > > for (int i = 0; i < invalidStrict.length; i++) {
> > > final String text = "idx=[" + i + "] value=[" +
> > > invalidStrict[i] + "]";
> > > - assertNull(strictValidator.parse(invalidStrict[i], null,
> > > Locale.US), () -> "(A) " + text);
> > > - assertFalse(strictValidator.isValid(invalidStrict[i],
> null,
> > > Locale.US), () -> "(B) " + text);
> > > - assertNull(strictValidator.parse(invalidStrict[i],
> > > testPattern, null), () -> "(C) " + text);
> > > - assertFalse(strictValidator.isValid(invalidStrict[i],
> > > testPattern, null), () -> "(D) " + text);
> > > + assertNull(strictValidator.parse(invalidStrict[i], null,
> > > Locale.US), "(A) " + text);
> > > + assertFalse(strictValidator.isValid(invalidStrict[i],
> null,
> > > Locale.US), "(B) " + text);
> > > + assertNull(strictValidator.parse(invalidStrict[i],
> > > testPattern, null), "(C) " + text);
> > > + assertFalse(strictValidator.isValid(invalidStrict[i],
> > > testPattern, null), "(D) " + text);
> > > }
> > > }
> > >
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > > index 49971f2e..8566dde0 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > > @@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
> > > "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh",
> //
> > > '%' in node id
> > > };
> > > for (final String item : valid) {
> > > - assertTrue(validator.isValid(item), () ->
> String.format("%s
> > > should be valid", item));
> > > + assertTrue(validator.isValid(item), String.format("%s
> should
> > > be valid", item));
> > > }
> > > for (final String item : invalid) {
> > > - assertFalse(validator.isValid(item), () ->
> String.format("%s
> > > should be invalid", item));
> > > + assertFalse(validator.isValid(item), String.format("%s
> > should
> > > be invalid", item));
> > > }
> > > }
> > > }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > > index 72747901..bbeca924 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > > @@ -198,8 +198,8 @@ public class TimeValidatorTest {
> > > for (int i = 0; i < localeInvalid.length; i++) {
> > > final String text = i + " value=[" + localeInvalid[i] + "]
> > > passed ";
> > > final Object date = validator.validate(localeInvalid[i],
> > > Locale.US);
> > > - assertNull(date, () -> "validate() " + text + date);
> > > - assertFalse(validator.isValid(localeInvalid[i],
> Locale.UK),
> > > () -> "isValid() " + text);
> > > + assertNull(date, "validate() " + text + date);
> > > + assertFalse(validator.isValid(localeInvalid[i],
> Locale.UK),
> > > "isValid() " + text);
> > > }
> > > }
> > >
> > > @@ -211,10 +211,10 @@ public class TimeValidatorTest {
> > > for (int i = 0; i < localeValid.length; i++) {
> > > final String text = i + " value=[" + localeValid[i] + "]
> > > failed ";
> > > final Calendar calendar =
> validator.validate(localeValid[i],
> > > Locale.UK);
> > > - assertNotNull(calendar, () -> "validate() " + text);
> > > + assertNotNull(calendar, "validate() " + text);
> > > final Date date = calendar.getTime();
> > > - assertTrue(validator.isValid(localeValid[i], Locale.UK),
> ()
> > > -> "isValid() " + text);
> > > - assertEquals(localeExpect[i], date, () -> "compare " +
> > text);
> > > + assertTrue(validator.isValid(localeValid[i], Locale.UK),
> > > "isValid() " + text);
> > > + assertEquals(localeExpect[i], date, "compare " + text);
> > > }
> > > }
> > >
> > > @@ -226,8 +226,8 @@ public class TimeValidatorTest {
> > > for (int i = 0; i < patternInvalid.length; i++) {
> > > final String text = i + " value=[" + patternInvalid[i] +
> "]
> > > passed ";
> > > final Object date = validator.validate(patternInvalid[i],
> > > "HH-mm-ss");
> > > - assertNull(date, () -> "validate() " + text + date);
> > > - assertFalse(validator.isValid(patternInvalid[i],
> > "HH-mm-ss"),
> > > () -> "isValid() " + text);
> > > + assertNull(date, "validate() " + text + date);
> > > + assertFalse(validator.isValid(patternInvalid[i],
> > "HH-mm-ss"),
> > > "isValid() " + text);
> > > }
> > > }
> > >
> > > @@ -239,10 +239,10 @@ public class TimeValidatorTest {
> > > for (int i = 0; i < patternValid.length; i++) {
> > > final String text = i + " value=[" + patternValid[i] + "]
> > > failed ";
> > > final Calendar calendar =
> > validator.validate(patternValid[i],
> > > "HH-mm-ss");
> > > - assertNotNull(calendar, () -> "validateObj() " + text);
> > > + assertNotNull(calendar, "validateObj() " + text);
> > > final Date date = calendar.getTime();
> > > - assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> > ()
> > > -> "isValid() " + text);
> > > - assertEquals(patternExpect[i], date, () -> "compare " +
> > text);
> > > + assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> > > "isValid() " + text);
> > > + assertEquals(patternExpect[i], date, "compare " + text);
> > > }
> > > }
> > >
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > > index 69136900..fb5df1f2 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > > @@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > > @Test
> > > public void testValidator336InvalidCheckDigits() {
> > > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > > }
> > > }
> > >
> > > @Test
> > > public void testValidator336ValidCheckDigits() {
> > > for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > > - assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > > fail: " + validCheckDigit);
> > > + assertTrue(routine.isValid(validCheckDigit), "Should
> fail: "
> > > + validCheckDigit);
> > > }
> > > }
> > > }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > > index f84ec5ce..62b9cb25 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > > @@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > > @Test
> > > public void testValidator345() {
> > > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > > }
> > > }
> > > }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > > index 1217ef90..8dd23b9a 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > > @@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > > @Test
> > > public void testValidator336InvalidCheckDigits() {
> > > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > > }
> > > }
> > >
> > > @Test
> > > public void testValidator336ValidCheckDigits() {
> > > for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > > - assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > > fail: " + validCheckDigit);
> > > + assertTrue(routine.isValid(validCheckDigit), "Should
> fail: "
> > > + validCheckDigit);
> > > }
> > > }
> > > }
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > > index 90d03eb0..12458a83 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > > @@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > > @Test
> > > public void testValidator346() {
> > > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > > }
> > > }
> > >
> > > diff --git
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > > index 47017a36..43712ed6 100644
> > > ---
> > >
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > > +++
> > >
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > > @@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends
> > > AbstractCheckDigitTest {
> > > @Test
> > > public void testValidator346() {
> > > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> > "Should
> > > fail: " + invalidCheckDigit);
> > > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> > fail:
> > > " + invalidCheckDigit);
> > > }
> > > }
> > >
> > >
> > >
> >
>
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Mike Drob <md...@mdrob.com>.
In practical terms, what is the time cost? I imagined the lambda APIs
existing to avoid heavy processing, like printing out the state of a
database or other large complex graph. StringBuilder doesn't seem like a
huge issue and the readability is nice. Have we spent more time writing
these emails than would be saved over the lifetime of every developer who
ever runs the tests?
On Mon, Nov 18, 2024 at 10:12 AM Gary Gregory <ga...@gmail.com>
wrote:
> -1 you are undoing the port to JUnit 5. This commit is a classic JUnit
> mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
> avoid construction of failure message strings, which, as a pattern, add
> processing, can have side effects, and always creates more garbage. This is
> bad since in general toString() methods can do anything. String.format() is
> a great way to create nice messages in a compact way but is not free.
>
> Gary
>
> On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
>
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > ebourg pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/commons-validator.git
> >
> > commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
> > Author: Emmanuel Bourg <eb...@apache.org>
> > AuthorDate: Mon Nov 18 11:22:35 2024 +0100
> >
> > Removed unnecessary lambdas in the tests
> > ---
> > .../commons/validator/AbstractNumberTest.java | 6 ++--
> > .../org/apache/commons/validator/DateTest.java | 6 ++--
> > .../org/apache/commons/validator/EmailTest.java | 6 ++--
> > .../validator/GenericTypeValidatorTest.java | 16 ++++-----
> > .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
> > .../apache/commons/validator/ParameterTest.java | 4 +--
> > .../apache/commons/validator/RequiredIfTest.java | 36
> > +++++++++----------
> > .../apache/commons/validator/RequiredNameTest.java | 40
> > +++++++++++-----------
> > .../commons/validator/ValidatorResultsTest.java | 10 +++---
> > .../routines/AbstractNumberValidatorTest.java | 16 ++++-----
> > .../routines/InetAddressValidatorTest.java | 4 +--
> > .../validator/routines/TimeValidatorTest.java | 20 +++++------
> > .../routines/checkdigit/CUSIPCheckDigitTest.java | 4 +--
> > .../routines/checkdigit/ISINCheckDigitTest.java | 2 +-
> > .../checkdigit/ModulusTenCUSIPCheckDigitTest.java | 4 +--
> > .../checkdigit/ModulusTenSedolCheckDigitTest.java | 2 +-
> > .../routines/checkdigit/SedolCheckDigitTest.java | 2 +-
> > 17 files changed, 99 insertions(+), 99 deletions(-)
> >
> > diff --git
> > a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > index b245c536..6652428e 100644
> > --- a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > +++ b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> > @@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends
> > AbstractCommonTest {
> >
> > final ValidatorResult result =
> > results.getValidatorResult("value");
> >
> > - assertNotNull(result, () -> action + " value ValidatorResult
> > should not be null.");
> > - assertTrue(result.containsAction(action), () -> action + " value
> > ValidatorResult should contain the '" + action + "' action.");
> > + assertNotNull(result, action + " value ValidatorResult should
> not
> > be null.");
> > + assertTrue(result.containsAction(action), action + " value
> > ValidatorResult should contain the '" + action + "' action.");
> > assertTrue(passed ? result.isValid(action) :
> > !result.isValid(action),
> > - () -> action + " value ValidatorResult for the '" +
> > action + "' action should have " + (passed ? "passed" : "failed") + ".");
> > + action + " value ValidatorResult for the '" + action +
> "'
> > action should have " + (passed ? "passed" : "failed") + ".");
> > }
> >
> > }
> > diff --git a/src/test/java/org/apache/commons/validator/DateTest.java
> > b/src/test/java/org/apache/commons/validator/DateTest.java
> > index c7db41d4..a42d6b4c 100644
> > --- a/src/test/java/org/apache/commons/validator/DateTest.java
> > +++ b/src/test/java/org/apache/commons/validator/DateTest.java
> > @@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
> >
> > final ValidatorResult result =
> > results.getValidatorResult("value");
> >
> > - assertNotNull(result, () -> ACTION + " value ValidatorResult
> > should not be null.");
> > - assertTrue(result.containsAction(ACTION), () -> ACTION + " value
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertNotNull(result, ACTION + " value ValidatorResult should
> not
> > be null.");
> > + assertTrue(result.containsAction(ACTION), ACTION + " value
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > assertTrue(passed ? result.isValid(ACTION) :
> > !result.isValid(ACTION),
> > - () -> ACTION + " value ValidatorResult for the '" +
> > ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
> > + ACTION + " value ValidatorResult for the '" + ACTION +
> "'
> > action should have " + (passed ? "passed" : "failed") + ".");
> > }
> >
> > }
> > diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java
> > b/src/test/java/org/apache/commons/validator/EmailTest.java
> > index 39a78230..92ae84ce 100644
> > --- a/src/test/java/org/apache/commons/validator/EmailTest.java
> > +++ b/src/test/java/org/apache/commons/validator/EmailTest.java
> > @@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
> >
> > final ValidatorResult result =
> > results.getValidatorResult("value");
> >
> > - assertNotNull(result, () -> ACTION + " value ValidatorResult
> > should not be null.");
> > - assertTrue(result.containsAction(ACTION), () -> "Value " +
> > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > action.");
> > + assertNotNull(result, ACTION + " value ValidatorResult should
> not
> > be null.");
> > + assertTrue(result.containsAction(ACTION), "Value " +
> > info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> > action.");
> > assertTrue(passed ? result.isValid(ACTION) :
> > !result.isValid(ACTION),
> > - () -> "Value " + info.getValue() + "ValidatorResult for
> > the '" + ACTION + "' action should have " + (passed ? "passed" :
> "failed")
> > + ".");
> > + "Value " + info.getValue() + "ValidatorResult for the '"
> > + ACTION + "' action should have " + (passed ? "passed" : "failed") +
> ".");
> > }
> > }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > index 104bfb4f..dd70d65f 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> > @@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends
> > AbstractCommonTest {
> >
> > final Map<String, ?> hResultValues =
> results.getResultValueMap();
> >
> > - assertInstanceOf(Byte.class, hResultValues.get("byte"), () ->
> > "Expecting byte result to be an instance of Byte for locale: " + locale);
> > - assertInstanceOf(Short.class, hResultValues.get("short"), () ->
> > "Expecting short result to be an instance of Short for locale: " +
> locale);
> > - assertInstanceOf(Integer.class, hResultValues.get("integer"), ()
> > -> "Expecting integer result to be an instance of Integer for locale: " +
> > locale);
> > - assertInstanceOf(Long.class, hResultValues.get("long"), () ->
> > "Expecting long result to be an instance of Long for locale: " + locale);
> > - assertInstanceOf(Float.class, hResultValues.get("float"), () ->
> > "Expecting float result to be an instance of Float for locale: " +
> locale);
> > - assertInstanceOf(Double.class, hResultValues.get("double"), ()
> ->
> > "Expecting double result to be an instance of Double for locale: " +
> > locale);
> > - assertInstanceOf(Date.class, hResultValues.get("date"), () ->
> > "Expecting date result to be an instance of Date for locale: " + locale);
> > + assertInstanceOf(Byte.class, hResultValues.get("byte"),
> > "Expecting byte result to be an instance of Byte for locale: " + locale);
> > + assertInstanceOf(Short.class, hResultValues.get("short"),
> > "Expecting short result to be an instance of Short for locale: " +
> locale);
> > + assertInstanceOf(Integer.class, hResultValues.get("integer"),
> > "Expecting integer result to be an instance of Integer for locale: " +
> > locale);
> > + assertInstanceOf(Long.class, hResultValues.get("long"),
> > "Expecting long result to be an instance of Long for locale: " + locale);
> > + assertInstanceOf(Float.class, hResultValues.get("float"),
> > "Expecting float result to be an instance of Float for locale: " +
> locale);
> > + assertInstanceOf(Double.class, hResultValues.get("double"),
> > "Expecting double result to be an instance of Double for locale: " +
> > locale);
> > + assertInstanceOf(Date.class, hResultValues.get("date"),
> > "Expecting date result to be an instance of Date for locale: " + locale);
> >
> > for (final String key : hResultValues.keySet()) {
> > final Object value = hResultValues.get(key);
> >
> > - assertNotNull(value, () -> "value
> > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > locale);
> > + assertNotNull(value, "value
> > ValidatorResults.getResultValueMap() should not be null for locale: " +
> > locale);
> > }
> > return hResultValues;
> > }
> > diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > index 5e9cfa04..e20cedea 100644
> > --- a/src/test/java/org/apache/commons/validator/MultipleTest.java
> > +++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
> > @@ -83,12 +83,12 @@ public class MultipleTest extends AbstractCommonTest
> {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > assertFalse(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResults should not contain the 'int' action.");
> > }
> >
> > @@ -262,8 +262,8 @@ public class MultipleTest extends AbstractCommonTest
> {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > assertTrue(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResult should contain the 'int' action.");
> > @@ -296,8 +296,8 @@ public class MultipleTest extends AbstractCommonTest
> {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > assertTrue(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResult should contain the 'int' action.");
> > @@ -330,8 +330,8 @@ public class MultipleTest extends AbstractCommonTest
> {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > assertTrue(lastNameResult.containsAction("int"), "Last Name
> > ValidatorResult should contain the 'int' action.");
> > diff --git
> a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > index 629c06e7..c254d160 100644
> > --- a/src/test/java/org/apache/commons/validator/ParameterTest.java
> > +++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
> > @@ -43,8 +43,8 @@ public class ParameterTest extends AbstractCommonTest {
> >
> > private void assertParameterValue(final Validator validator, final
> > String name, final Class<?> type) {
> > final Object value = validator.getParameterValue(name);
> > - assertNotNull(value, () -> "Expected '" + type.getName() + "'
> but
> > was null");
> > - assertTrue(type.isInstance(value), () -> "Expected '" +
> > type.getName() + "' but was '" + value.getClass().getName() + "'");
> > + assertNotNull(value, "Expected '" + type.getName() + "' but was
> > null");
> > + assertTrue(type.isInstance(value), "Expected '" + type.getName()
> > + "' but was '" + value.getClass().getName() + "'");
> > }
> >
> > /**
> > diff --git
> > a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > index 699db985..95324a37 100644
> > --- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > +++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> > @@ -83,12 +83,12 @@ public class RequiredIfTest extends
> AbstractCommonTest
> > {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > }
> >
> > /**
> > @@ -117,12 +117,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > }
> >
> > /**
> > @@ -151,12 +151,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > }
> >
> > /**
> > @@ -189,8 +189,8 @@ public class RequiredIfTest extends
> AbstractCommonTest
> > {
> > assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > }
> >
> > @@ -220,12 +220,12 @@ public class RequiredIfTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "Last Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > }
> >
> > }
> > diff --git
> > a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > index 6578e360..05689158 100644
> > --- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > +++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> > @@ -83,8 +83,8 @@ public class RequiredNameTest extends
> AbstractCommonTest
> > {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > @@ -116,12 +116,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > }
> >
> > /**
> > @@ -149,12 +149,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > }
> >
> > /**
> > @@ -182,12 +182,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > }
> >
> > @@ -220,8 +220,8 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> > assertFalse(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> >
> > assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have failed.");
> > }
> >
> > /**
> > @@ -250,12 +250,12 @@ public class RequiredNameTest extends
> > AbstractCommonTest {
> > final ValidatorResult lastNameResult =
> > results.getValidatorResult("lastName");
> >
> > assertNotNull(firstNameResult, "First Name ValidatorResult
> should
> > not be null.");
> > - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(firstNameResult.isValid(ACTION), "First Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> >
> > assertNotNull(lastNameResult, "First Name ValidatorResult should
> > not be null.");
> > - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> > Name ValidatorResult should contain the '" + ACTION + "' action.");
> > - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> > ValidatorResult should contain the '" + ACTION + "' action.");
> > + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> > ValidatorResult for the '" + ACTION + "' action should have passed.");
> > }
> >
> > }
> > \ No newline at end of file
> > diff --git
> > a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > index b956d071..54a8f5fb 100644
> > ---
> a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > +++
> b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> > @@ -47,8 +47,8 @@ public class ValidatorResultsTest extends
> > AbstractCommonTest {
> > */
> > private void checkNotRun(final ValidatorResults results, final
> String
> > field, final String action) {
> > final ValidatorResult result =
> results.getValidatorResult(field);
> > - assertNotNull(result, () -> field + " result");
> > - assertFalse(result.containsAction(action), () -> field + "[" +
> > action + "] run");
> > + assertNotNull(result, field + " result");
> > + assertFalse(result.containsAction(action), field + "[" + action
> +
> > "] run");
> > // System.out.println(field + "[" + action + "] not run");
> > }
> >
> > @@ -58,9 +58,9 @@ public class ValidatorResultsTest extends
> > AbstractCommonTest {
> > private void checkValidatorResult(final ValidatorResults results,
> > final String field, final String action, final boolean expected) {
> > final ValidatorResult result =
> results.getValidatorResult(field);
> > // System.out.println(field + "[" + action + "]=" +
> > result.isValid(action));
> > - assertNotNull(result, () -> field + " result");
> > - assertTrue(result.containsAction(action), () -> field + "[" +
> > action + "] not run");
> > - assertEquals(expected, result.isValid(action), () -> field + "["
> > + action + "] result");
> > + assertNotNull(result, field + " result");
> > + assertTrue(result.containsAction(action), field + "[" + action +
> > "] not run");
> > + assertEquals(expected, result.isValid(action), field + "[" +
> > action + "] result");
> > }
> >
> > /**
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > index a9847cf8..66849f25 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> > @@ -107,10 +107,10 @@ public abstract class AbstractNumberValidatorTest {
> > public void testInvalidNotStrict() {
> > for (int i = 0; i < invalid.length; i++) {
> > final String text = "idx=[" + i + "] value=[" + invalid[i] +
> > "]";
> > - assertNull(validator.parse(invalid[i], null, Locale.US), ()
> > -> "(A) " + text);
> > - assertFalse(validator.isValid(invalid[i], null, Locale.US),
> > () -> "(B) " + text);
> > - assertNull(validator.parse(invalid[i], testPattern, null),
> ()
> > -> "(C) " + text);
> > - assertFalse(validator.isValid(invalid[i], testPattern,
> null),
> > () -> "(D) " + text);
> > + assertNull(validator.parse(invalid[i], null, Locale.US),
> "(A)
> > " + text);
> > + assertFalse(validator.isValid(invalid[i], null, Locale.US),
> > "(B) " + text);
> > + assertNull(validator.parse(invalid[i], testPattern, null),
> > "(C) " + text);
> > + assertFalse(validator.isValid(invalid[i], testPattern,
> null),
> > "(D) " + text);
> > }
> > }
> >
> > @@ -121,10 +121,10 @@ public abstract class AbstractNumberValidatorTest {
> > public void testInvalidStrict() {
> > for (int i = 0; i < invalidStrict.length; i++) {
> > final String text = "idx=[" + i + "] value=[" +
> > invalidStrict[i] + "]";
> > - assertNull(strictValidator.parse(invalidStrict[i], null,
> > Locale.US), () -> "(A) " + text);
> > - assertFalse(strictValidator.isValid(invalidStrict[i], null,
> > Locale.US), () -> "(B) " + text);
> > - assertNull(strictValidator.parse(invalidStrict[i],
> > testPattern, null), () -> "(C) " + text);
> > - assertFalse(strictValidator.isValid(invalidStrict[i],
> > testPattern, null), () -> "(D) " + text);
> > + assertNull(strictValidator.parse(invalidStrict[i], null,
> > Locale.US), "(A) " + text);
> > + assertFalse(strictValidator.isValid(invalidStrict[i], null,
> > Locale.US), "(B) " + text);
> > + assertNull(strictValidator.parse(invalidStrict[i],
> > testPattern, null), "(C) " + text);
> > + assertFalse(strictValidator.isValid(invalidStrict[i],
> > testPattern, null), "(D) " + text);
> > }
> > }
> >
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > index 49971f2e..8566dde0 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> > @@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
> > "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh", //
> > '%' in node id
> > };
> > for (final String item : valid) {
> > - assertTrue(validator.isValid(item), () -> String.format("%s
> > should be valid", item));
> > + assertTrue(validator.isValid(item), String.format("%s should
> > be valid", item));
> > }
> > for (final String item : invalid) {
> > - assertFalse(validator.isValid(item), () -> String.format("%s
> > should be invalid", item));
> > + assertFalse(validator.isValid(item), String.format("%s
> should
> > be invalid", item));
> > }
> > }
> > }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > index 72747901..bbeca924 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> > @@ -198,8 +198,8 @@ public class TimeValidatorTest {
> > for (int i = 0; i < localeInvalid.length; i++) {
> > final String text = i + " value=[" + localeInvalid[i] + "]
> > passed ";
> > final Object date = validator.validate(localeInvalid[i],
> > Locale.US);
> > - assertNull(date, () -> "validate() " + text + date);
> > - assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> > () -> "isValid() " + text);
> > + assertNull(date, "validate() " + text + date);
> > + assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> > "isValid() " + text);
> > }
> > }
> >
> > @@ -211,10 +211,10 @@ public class TimeValidatorTest {
> > for (int i = 0; i < localeValid.length; i++) {
> > final String text = i + " value=[" + localeValid[i] + "]
> > failed ";
> > final Calendar calendar = validator.validate(localeValid[i],
> > Locale.UK);
> > - assertNotNull(calendar, () -> "validate() " + text);
> > + assertNotNull(calendar, "validate() " + text);
> > final Date date = calendar.getTime();
> > - assertTrue(validator.isValid(localeValid[i], Locale.UK), ()
> > -> "isValid() " + text);
> > - assertEquals(localeExpect[i], date, () -> "compare " +
> text);
> > + assertTrue(validator.isValid(localeValid[i], Locale.UK),
> > "isValid() " + text);
> > + assertEquals(localeExpect[i], date, "compare " + text);
> > }
> > }
> >
> > @@ -226,8 +226,8 @@ public class TimeValidatorTest {
> > for (int i = 0; i < patternInvalid.length; i++) {
> > final String text = i + " value=[" + patternInvalid[i] + "]
> > passed ";
> > final Object date = validator.validate(patternInvalid[i],
> > "HH-mm-ss");
> > - assertNull(date, () -> "validate() " + text + date);
> > - assertFalse(validator.isValid(patternInvalid[i],
> "HH-mm-ss"),
> > () -> "isValid() " + text);
> > + assertNull(date, "validate() " + text + date);
> > + assertFalse(validator.isValid(patternInvalid[i],
> "HH-mm-ss"),
> > "isValid() " + text);
> > }
> > }
> >
> > @@ -239,10 +239,10 @@ public class TimeValidatorTest {
> > for (int i = 0; i < patternValid.length; i++) {
> > final String text = i + " value=[" + patternValid[i] + "]
> > failed ";
> > final Calendar calendar =
> validator.validate(patternValid[i],
> > "HH-mm-ss");
> > - assertNotNull(calendar, () -> "validateObj() " + text);
> > + assertNotNull(calendar, "validateObj() " + text);
> > final Date date = calendar.getTime();
> > - assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> ()
> > -> "isValid() " + text);
> > - assertEquals(patternExpect[i], date, () -> "compare " +
> text);
> > + assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> > "isValid() " + text);
> > + assertEquals(patternExpect[i], date, "compare " + text);
> > }
> > }
> >
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > index 69136900..fb5df1f2 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> > @@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends
> > AbstractCheckDigitTest {
> > @Test
> > public void testValidator336InvalidCheckDigits() {
> > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> > }
> > }
> >
> > @Test
> > public void testValidator336ValidCheckDigits() {
> > for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > - assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > fail: " + validCheckDigit);
> > + assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> > + validCheckDigit);
> > }
> > }
> > }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > index f84ec5ce..62b9cb25 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> > @@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends
> > AbstractCheckDigitTest {
> > @Test
> > public void testValidator345() {
> > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> > }
> > }
> > }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > index 1217ef90..8dd23b9a 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> > @@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends
> > AbstractCheckDigitTest {
> > @Test
> > public void testValidator336InvalidCheckDigits() {
> > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> > }
> > }
> >
> > @Test
> > public void testValidator336ValidCheckDigits() {
> > for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> > - assertTrue(routine.isValid(validCheckDigit), () -> "Should
> > fail: " + validCheckDigit);
> > + assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> > + validCheckDigit);
> > }
> > }
> > }
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > index 90d03eb0..12458a83 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> > @@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends
> > AbstractCheckDigitTest {
> > @Test
> > public void testValidator346() {
> > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> > }
> > }
> >
> > diff --git
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > index 47017a36..43712ed6 100644
> > ---
> >
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > +++
> >
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> > @@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends
> > AbstractCheckDigitTest {
> > @Test
> > public void testValidator346() {
> > for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> > - assertFalse(routine.isValid(invalidCheckDigit), () ->
> "Should
> > fail: " + invalidCheckDigit);
> > + assertFalse(routine.isValid(invalidCheckDigit), "Should
> fail:
> > " + invalidCheckDigit);
> > }
> > }
> >
> >
> >
>
Re: (commons-validator) 08/11: Removed unnecessary lambdas in the tests
Posted by Gary Gregory <ga...@gmail.com>.
-1 you are undoing the port to JUnit 5. This commit is a classic JUnit
mistake imo, please stop, these JUnit APIs exist for a reason: The lambdas
avoid construction of failure message strings, which, as a pattern, add
processing, can have side effects, and always creates more garbage. This is
bad since in general toString() methods can do anything. String.format() is
a great way to create nice messages in a compact way but is not free.
Gary
On Mon, Nov 18, 2024, 7:53 AM <eb...@apache.org> wrote:
> This is an automated email from the ASF dual-hosted git repository.
>
> ebourg pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/commons-validator.git
>
> commit dfd4a9e426ea6d0901af757ce333d2577772b2b1
> Author: Emmanuel Bourg <eb...@apache.org>
> AuthorDate: Mon Nov 18 11:22:35 2024 +0100
>
> Removed unnecessary lambdas in the tests
> ---
> .../commons/validator/AbstractNumberTest.java | 6 ++--
> .../org/apache/commons/validator/DateTest.java | 6 ++--
> .../org/apache/commons/validator/EmailTest.java | 6 ++--
> .../validator/GenericTypeValidatorTest.java | 16 ++++-----
> .../org/apache/commons/validator/MultipleTest.java | 20 +++++------
> .../apache/commons/validator/ParameterTest.java | 4 +--
> .../apache/commons/validator/RequiredIfTest.java | 36
> +++++++++----------
> .../apache/commons/validator/RequiredNameTest.java | 40
> +++++++++++-----------
> .../commons/validator/ValidatorResultsTest.java | 10 +++---
> .../routines/AbstractNumberValidatorTest.java | 16 ++++-----
> .../routines/InetAddressValidatorTest.java | 4 +--
> .../validator/routines/TimeValidatorTest.java | 20 +++++------
> .../routines/checkdigit/CUSIPCheckDigitTest.java | 4 +--
> .../routines/checkdigit/ISINCheckDigitTest.java | 2 +-
> .../checkdigit/ModulusTenCUSIPCheckDigitTest.java | 4 +--
> .../checkdigit/ModulusTenSedolCheckDigitTest.java | 2 +-
> .../routines/checkdigit/SedolCheckDigitTest.java | 2 +-
> 17 files changed, 99 insertions(+), 99 deletions(-)
>
> diff --git
> a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> index b245c536..6652428e 100644
> --- a/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> +++ b/src/test/java/org/apache/commons/validator/AbstractNumberTest.java
> @@ -100,10 +100,10 @@ public abstract class AbstractNumberTest extends
> AbstractCommonTest {
>
> final ValidatorResult result =
> results.getValidatorResult("value");
>
> - assertNotNull(result, () -> action + " value ValidatorResult
> should not be null.");
> - assertTrue(result.containsAction(action), () -> action + " value
> ValidatorResult should contain the '" + action + "' action.");
> + assertNotNull(result, action + " value ValidatorResult should not
> be null.");
> + assertTrue(result.containsAction(action), action + " value
> ValidatorResult should contain the '" + action + "' action.");
> assertTrue(passed ? result.isValid(action) :
> !result.isValid(action),
> - () -> action + " value ValidatorResult for the '" +
> action + "' action should have " + (passed ? "passed" : "failed") + ".");
> + action + " value ValidatorResult for the '" + action + "'
> action should have " + (passed ? "passed" : "failed") + ".");
> }
>
> }
> diff --git a/src/test/java/org/apache/commons/validator/DateTest.java
> b/src/test/java/org/apache/commons/validator/DateTest.java
> index c7db41d4..a42d6b4c 100644
> --- a/src/test/java/org/apache/commons/validator/DateTest.java
> +++ b/src/test/java/org/apache/commons/validator/DateTest.java
> @@ -98,10 +98,10 @@ public class DateTest extends AbstractCommonTest {
>
> final ValidatorResult result =
> results.getValidatorResult("value");
>
> - assertNotNull(result, () -> ACTION + " value ValidatorResult
> should not be null.");
> - assertTrue(result.containsAction(ACTION), () -> ACTION + " value
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertNotNull(result, ACTION + " value ValidatorResult should not
> be null.");
> + assertTrue(result.containsAction(ACTION), ACTION + " value
> ValidatorResult should contain the '" + ACTION + "' action.");
> assertTrue(passed ? result.isValid(ACTION) :
> !result.isValid(ACTION),
> - () -> ACTION + " value ValidatorResult for the '" +
> ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
> + ACTION + " value ValidatorResult for the '" + ACTION + "'
> action should have " + (passed ? "passed" : "failed") + ".");
> }
>
> }
> diff --git a/src/test/java/org/apache/commons/validator/EmailTest.java
> b/src/test/java/org/apache/commons/validator/EmailTest.java
> index 39a78230..92ae84ce 100644
> --- a/src/test/java/org/apache/commons/validator/EmailTest.java
> +++ b/src/test/java/org/apache/commons/validator/EmailTest.java
> @@ -406,9 +406,9 @@ public class EmailTest extends AbstractCommonTest {
>
> final ValidatorResult result =
> results.getValidatorResult("value");
>
> - assertNotNull(result, () -> ACTION + " value ValidatorResult
> should not be null.");
> - assertTrue(result.containsAction(ACTION), () -> "Value " +
> info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> action.");
> + assertNotNull(result, ACTION + " value ValidatorResult should not
> be null.");
> + assertTrue(result.containsAction(ACTION), "Value " +
> info.getValue() + " ValidatorResult should contain the '" + ACTION + "'
> action.");
> assertTrue(passed ? result.isValid(ACTION) :
> !result.isValid(ACTION),
> - () -> "Value " + info.getValue() + "ValidatorResult for
> the '" + ACTION + "' action should have " + (passed ? "passed" : "failed")
> + ".");
> + "Value " + info.getValue() + "ValidatorResult for the '"
> + ACTION + "' action should have " + (passed ? "passed" : "failed") + ".");
> }
> }
> diff --git
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> index 104bfb4f..dd70d65f 100644
> ---
> a/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java
> @@ -69,18 +69,18 @@ public class GenericTypeValidatorTest extends
> AbstractCommonTest {
>
> final Map<String, ?> hResultValues = results.getResultValueMap();
>
> - assertInstanceOf(Byte.class, hResultValues.get("byte"), () ->
> "Expecting byte result to be an instance of Byte for locale: " + locale);
> - assertInstanceOf(Short.class, hResultValues.get("short"), () ->
> "Expecting short result to be an instance of Short for locale: " + locale);
> - assertInstanceOf(Integer.class, hResultValues.get("integer"), ()
> -> "Expecting integer result to be an instance of Integer for locale: " +
> locale);
> - assertInstanceOf(Long.class, hResultValues.get("long"), () ->
> "Expecting long result to be an instance of Long for locale: " + locale);
> - assertInstanceOf(Float.class, hResultValues.get("float"), () ->
> "Expecting float result to be an instance of Float for locale: " + locale);
> - assertInstanceOf(Double.class, hResultValues.get("double"), () ->
> "Expecting double result to be an instance of Double for locale: " +
> locale);
> - assertInstanceOf(Date.class, hResultValues.get("date"), () ->
> "Expecting date result to be an instance of Date for locale: " + locale);
> + assertInstanceOf(Byte.class, hResultValues.get("byte"),
> "Expecting byte result to be an instance of Byte for locale: " + locale);
> + assertInstanceOf(Short.class, hResultValues.get("short"),
> "Expecting short result to be an instance of Short for locale: " + locale);
> + assertInstanceOf(Integer.class, hResultValues.get("integer"),
> "Expecting integer result to be an instance of Integer for locale: " +
> locale);
> + assertInstanceOf(Long.class, hResultValues.get("long"),
> "Expecting long result to be an instance of Long for locale: " + locale);
> + assertInstanceOf(Float.class, hResultValues.get("float"),
> "Expecting float result to be an instance of Float for locale: " + locale);
> + assertInstanceOf(Double.class, hResultValues.get("double"),
> "Expecting double result to be an instance of Double for locale: " +
> locale);
> + assertInstanceOf(Date.class, hResultValues.get("date"),
> "Expecting date result to be an instance of Date for locale: " + locale);
>
> for (final String key : hResultValues.keySet()) {
> final Object value = hResultValues.get(key);
>
> - assertNotNull(value, () -> "value
> ValidatorResults.getResultValueMap() should not be null for locale: " +
> locale);
> + assertNotNull(value, "value
> ValidatorResults.getResultValueMap() should not be null for locale: " +
> locale);
> }
> return hResultValues;
> }
> diff --git a/src/test/java/org/apache/commons/validator/MultipleTest.java
> b/src/test/java/org/apache/commons/validator/MultipleTest.java
> index 5e9cfa04..e20cedea 100644
> --- a/src/test/java/org/apache/commons/validator/MultipleTest.java
> +++ b/src/test/java/org/apache/commons/validator/MultipleTest.java
> @@ -83,12 +83,12 @@ public class MultipleTest extends AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> assertFalse(lastNameResult.containsAction("int"), "Last Name
> ValidatorResults should not contain the 'int' action.");
> }
>
> @@ -262,8 +262,8 @@ public class MultipleTest extends AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> assertTrue(lastNameResult.containsAction("int"), "Last Name
> ValidatorResult should contain the 'int' action.");
> @@ -296,8 +296,8 @@ public class MultipleTest extends AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> assertTrue(lastNameResult.containsAction("int"), "Last Name
> ValidatorResult should contain the 'int' action.");
> @@ -330,8 +330,8 @@ public class MultipleTest extends AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> assertTrue(lastNameResult.containsAction("int"), "Last Name
> ValidatorResult should contain the 'int' action.");
> diff --git a/src/test/java/org/apache/commons/validator/ParameterTest.java
> b/src/test/java/org/apache/commons/validator/ParameterTest.java
> index 629c06e7..c254d160 100644
> --- a/src/test/java/org/apache/commons/validator/ParameterTest.java
> +++ b/src/test/java/org/apache/commons/validator/ParameterTest.java
> @@ -43,8 +43,8 @@ public class ParameterTest extends AbstractCommonTest {
>
> private void assertParameterValue(final Validator validator, final
> String name, final Class<?> type) {
> final Object value = validator.getParameterValue(name);
> - assertNotNull(value, () -> "Expected '" + type.getName() + "' but
> was null");
> - assertTrue(type.isInstance(value), () -> "Expected '" +
> type.getName() + "' but was '" + value.getClass().getName() + "'");
> + assertNotNull(value, "Expected '" + type.getName() + "' but was
> null");
> + assertTrue(type.isInstance(value), "Expected '" + type.getName()
> + "' but was '" + value.getClass().getName() + "'");
> }
>
> /**
> diff --git
> a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> index 699db985..95324a37 100644
> --- a/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> +++ b/src/test/java/org/apache/commons/validator/RequiredIfTest.java
> @@ -83,12 +83,12 @@ public class RequiredIfTest extends AbstractCommonTest
> {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> }
>
> /**
> @@ -117,12 +117,12 @@ public class RequiredIfTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> }
>
> /**
> @@ -151,12 +151,12 @@ public class RequiredIfTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> }
>
> /**
> @@ -189,8 +189,8 @@ public class RequiredIfTest extends AbstractCommonTest
> {
> assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> }
>
> @@ -220,12 +220,12 @@ public class RequiredIfTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "Last Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> }
>
> }
> diff --git
> a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> index 6578e360..05689158 100644
> --- a/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> +++ b/src/test/java/org/apache/commons/validator/RequiredNameTest.java
> @@ -83,8 +83,8 @@ public class RequiredNameTest extends AbstractCommonTest
> {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> @@ -116,12 +116,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> }
>
> /**
> @@ -149,12 +149,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> }
>
> /**
> @@ -182,12 +182,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> }
>
> @@ -220,8 +220,8 @@ public class RequiredNameTest extends
> AbstractCommonTest {
> assertFalse(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
>
> assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertFalse(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertFalse(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have failed.");
> }
>
> /**
> @@ -250,12 +250,12 @@ public class RequiredNameTest extends
> AbstractCommonTest {
> final ValidatorResult lastNameResult =
> results.getValidatorResult("lastName");
>
> assertNotNull(firstNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(firstNameResult.containsAction(ACTION), () -> "First
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(firstNameResult.isValid(ACTION), () -> "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(firstNameResult.containsAction(ACTION), "First Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(firstNameResult.isValid(ACTION), "First Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
>
> assertNotNull(lastNameResult, "First Name ValidatorResult should
> not be null.");
> - assertTrue(lastNameResult.containsAction(ACTION), () -> "Last
> Name ValidatorResult should contain the '" + ACTION + "' action.");
> - assertTrue(lastNameResult.isValid(ACTION), () -> "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> + assertTrue(lastNameResult.containsAction(ACTION), "Last Name
> ValidatorResult should contain the '" + ACTION + "' action.");
> + assertTrue(lastNameResult.isValid(ACTION), "Last Name
> ValidatorResult for the '" + ACTION + "' action should have passed.");
> }
>
> }
> \ No newline at end of file
> diff --git
> a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> index b956d071..54a8f5fb 100644
> --- a/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> +++ b/src/test/java/org/apache/commons/validator/ValidatorResultsTest.java
> @@ -47,8 +47,8 @@ public class ValidatorResultsTest extends
> AbstractCommonTest {
> */
> private void checkNotRun(final ValidatorResults results, final String
> field, final String action) {
> final ValidatorResult result = results.getValidatorResult(field);
> - assertNotNull(result, () -> field + " result");
> - assertFalse(result.containsAction(action), () -> field + "[" +
> action + "] run");
> + assertNotNull(result, field + " result");
> + assertFalse(result.containsAction(action), field + "[" + action +
> "] run");
> // System.out.println(field + "[" + action + "] not run");
> }
>
> @@ -58,9 +58,9 @@ public class ValidatorResultsTest extends
> AbstractCommonTest {
> private void checkValidatorResult(final ValidatorResults results,
> final String field, final String action, final boolean expected) {
> final ValidatorResult result = results.getValidatorResult(field);
> // System.out.println(field + "[" + action + "]=" +
> result.isValid(action));
> - assertNotNull(result, () -> field + " result");
> - assertTrue(result.containsAction(action), () -> field + "[" +
> action + "] not run");
> - assertEquals(expected, result.isValid(action), () -> field + "["
> + action + "] result");
> + assertNotNull(result, field + " result");
> + assertTrue(result.containsAction(action), field + "[" + action +
> "] not run");
> + assertEquals(expected, result.isValid(action), field + "[" +
> action + "] result");
> }
>
> /**
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> index a9847cf8..66849f25 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/AbstractNumberValidatorTest.java
> @@ -107,10 +107,10 @@ public abstract class AbstractNumberValidatorTest {
> public void testInvalidNotStrict() {
> for (int i = 0; i < invalid.length; i++) {
> final String text = "idx=[" + i + "] value=[" + invalid[i] +
> "]";
> - assertNull(validator.parse(invalid[i], null, Locale.US), ()
> -> "(A) " + text);
> - assertFalse(validator.isValid(invalid[i], null, Locale.US),
> () -> "(B) " + text);
> - assertNull(validator.parse(invalid[i], testPattern, null), ()
> -> "(C) " + text);
> - assertFalse(validator.isValid(invalid[i], testPattern, null),
> () -> "(D) " + text);
> + assertNull(validator.parse(invalid[i], null, Locale.US), "(A)
> " + text);
> + assertFalse(validator.isValid(invalid[i], null, Locale.US),
> "(B) " + text);
> + assertNull(validator.parse(invalid[i], testPattern, null),
> "(C) " + text);
> + assertFalse(validator.isValid(invalid[i], testPattern, null),
> "(D) " + text);
> }
> }
>
> @@ -121,10 +121,10 @@ public abstract class AbstractNumberValidatorTest {
> public void testInvalidStrict() {
> for (int i = 0; i < invalidStrict.length; i++) {
> final String text = "idx=[" + i + "] value=[" +
> invalidStrict[i] + "]";
> - assertNull(strictValidator.parse(invalidStrict[i], null,
> Locale.US), () -> "(A) " + text);
> - assertFalse(strictValidator.isValid(invalidStrict[i], null,
> Locale.US), () -> "(B) " + text);
> - assertNull(strictValidator.parse(invalidStrict[i],
> testPattern, null), () -> "(C) " + text);
> - assertFalse(strictValidator.isValid(invalidStrict[i],
> testPattern, null), () -> "(D) " + text);
> + assertNull(strictValidator.parse(invalidStrict[i], null,
> Locale.US), "(A) " + text);
> + assertFalse(strictValidator.isValid(invalidStrict[i], null,
> Locale.US), "(B) " + text);
> + assertNull(strictValidator.parse(invalidStrict[i],
> testPattern, null), "(C) " + text);
> + assertFalse(strictValidator.isValid(invalidStrict[i],
> testPattern, null), "(D) " + text);
> }
> }
>
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> index 49971f2e..8566dde0 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java
> @@ -672,10 +672,10 @@ public class InetAddressValidatorTest {
> "2001:0000:1234:0000:0000:C1C0:ABCD:0876%abc%defgh", //
> '%' in node id
> };
> for (final String item : valid) {
> - assertTrue(validator.isValid(item), () -> String.format("%s
> should be valid", item));
> + assertTrue(validator.isValid(item), String.format("%s should
> be valid", item));
> }
> for (final String item : invalid) {
> - assertFalse(validator.isValid(item), () -> String.format("%s
> should be invalid", item));
> + assertFalse(validator.isValid(item), String.format("%s should
> be invalid", item));
> }
> }
> }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> index 72747901..bbeca924 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/TimeValidatorTest.java
> @@ -198,8 +198,8 @@ public class TimeValidatorTest {
> for (int i = 0; i < localeInvalid.length; i++) {
> final String text = i + " value=[" + localeInvalid[i] + "]
> passed ";
> final Object date = validator.validate(localeInvalid[i],
> Locale.US);
> - assertNull(date, () -> "validate() " + text + date);
> - assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> () -> "isValid() " + text);
> + assertNull(date, "validate() " + text + date);
> + assertFalse(validator.isValid(localeInvalid[i], Locale.UK),
> "isValid() " + text);
> }
> }
>
> @@ -211,10 +211,10 @@ public class TimeValidatorTest {
> for (int i = 0; i < localeValid.length; i++) {
> final String text = i + " value=[" + localeValid[i] + "]
> failed ";
> final Calendar calendar = validator.validate(localeValid[i],
> Locale.UK);
> - assertNotNull(calendar, () -> "validate() " + text);
> + assertNotNull(calendar, "validate() " + text);
> final Date date = calendar.getTime();
> - assertTrue(validator.isValid(localeValid[i], Locale.UK), ()
> -> "isValid() " + text);
> - assertEquals(localeExpect[i], date, () -> "compare " + text);
> + assertTrue(validator.isValid(localeValid[i], Locale.UK),
> "isValid() " + text);
> + assertEquals(localeExpect[i], date, "compare " + text);
> }
> }
>
> @@ -226,8 +226,8 @@ public class TimeValidatorTest {
> for (int i = 0; i < patternInvalid.length; i++) {
> final String text = i + " value=[" + patternInvalid[i] + "]
> passed ";
> final Object date = validator.validate(patternInvalid[i],
> "HH-mm-ss");
> - assertNull(date, () -> "validate() " + text + date);
> - assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"),
> () -> "isValid() " + text);
> + assertNull(date, "validate() " + text + date);
> + assertFalse(validator.isValid(patternInvalid[i], "HH-mm-ss"),
> "isValid() " + text);
> }
> }
>
> @@ -239,10 +239,10 @@ public class TimeValidatorTest {
> for (int i = 0; i < patternValid.length; i++) {
> final String text = i + " value=[" + patternValid[i] + "]
> failed ";
> final Calendar calendar = validator.validate(patternValid[i],
> "HH-mm-ss");
> - assertNotNull(calendar, () -> "validateObj() " + text);
> + assertNotNull(calendar, "validateObj() " + text);
> final Date date = calendar.getTime();
> - assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"), ()
> -> "isValid() " + text);
> - assertEquals(patternExpect[i], date, () -> "compare " + text);
> + assertTrue(validator.isValid(patternValid[i], "HH-mm-ss"),
> "isValid() " + text);
> + assertEquals(patternExpect[i], date, "compare " + text);
> }
> }
>
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> index 69136900..fb5df1f2 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/CUSIPCheckDigitTest.java
> @@ -44,14 +44,14 @@ public class CUSIPCheckDigitTest extends
> AbstractCheckDigitTest {
> @Test
> public void testValidator336InvalidCheckDigits() {
> for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> - assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> + assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
> }
> }
>
> @Test
> public void testValidator336ValidCheckDigits() {
> for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> - assertTrue(routine.isValid(validCheckDigit), () -> "Should
> fail: " + validCheckDigit);
> + assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> + validCheckDigit);
> }
> }
> }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> index f84ec5ce..62b9cb25 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ISINCheckDigitTest.java
> @@ -54,7 +54,7 @@ public class ISINCheckDigitTest extends
> AbstractCheckDigitTest {
> @Test
> public void testValidator345() {
> for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> - assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> + assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
> }
> }
> }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> index 1217ef90..8dd23b9a 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenCUSIPCheckDigitTest.java
> @@ -44,14 +44,14 @@ public class ModulusTenCUSIPCheckDigitTest extends
> AbstractCheckDigitTest {
> @Test
> public void testValidator336InvalidCheckDigits() {
> for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> - assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> + assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
> }
> }
>
> @Test
> public void testValidator336ValidCheckDigits() {
> for (final String validCheckDigit : VALID_CHECK_DIGITS) {
> - assertTrue(routine.isValid(validCheckDigit), () -> "Should
> fail: " + validCheckDigit);
> + assertTrue(routine.isValid(validCheckDigit), "Should fail: "
> + validCheckDigit);
> }
> }
> }
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> index 90d03eb0..12458a83 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/ModulusTenSedolCheckDigitTest.java
> @@ -47,7 +47,7 @@ public class ModulusTenSedolCheckDigitTest extends
> AbstractCheckDigitTest {
> @Test
> public void testValidator346() {
> for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> - assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> + assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
> }
> }
>
> diff --git
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> index 47017a36..43712ed6 100644
> ---
> a/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> +++
> b/src/test/java/org/apache/commons/validator/routines/checkdigit/SedolCheckDigitTest.java
> @@ -47,7 +47,7 @@ public class SedolCheckDigitTest extends
> AbstractCheckDigitTest {
> @Test
> public void testValidator346() {
> for (final String invalidCheckDigit : INVALID_CHECK_DIGITS) {
> - assertFalse(routine.isValid(invalidCheckDigit), () -> "Should
> fail: " + invalidCheckDigit);
> + assertFalse(routine.isValid(invalidCheckDigit), "Should fail:
> " + invalidCheckDigit);
> }
> }
>
>
>