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 <garydgreg...@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 <ebo...@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 <ebo...@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); > > } > > } > > > > > > >