This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-validator.git
commit 486059941cb61a2771c672d35fa6836becf18ba8 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed Dec 18 09:11:51 2024 -0500 Sort members --- .../validator/routines/IBANValidatorTest.java | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java index 63e0fe63..8cec6e21 100644 --- a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java +++ b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java @@ -342,26 +342,6 @@ public class IBANValidatorTest { return result; } - @ParameterizedTest - @MethodSource("ibanRegistryV98Source") - public void validatorShouldExistWithProperConfiguration(String countryName, String countryCode, List<String> acountyCode, int ibanLength, String structure) throws Exception { - String countryInfo = " countryCode: " + countryCode + ", countryName: " + countryName; - Validator validator = IBANValidator.getInstance().getValidator(countryCode); - - assertNotNull(validator, "IBAN validator returned null for" + countryInfo); - assertEquals(ibanLength, validator.getIbanLength(), "IBAN length should be " + ibanLength + " for" + countryInfo); - - List<String> allPatterns = Arrays.stream(validator.getRegexValidator().getPatterns()).map(Pattern::pattern).collect( - Collectors.toList()); - - String re = fmtRE(structure.substring(2)); - assertTrue(allPatterns.remove(countryCode + re), "No pattern " + countryCode + re + " found for " + countryInfo); - for (String ac : acountyCode) { - assertTrue(allPatterns.remove(ac + re), "No additional country code " + ac + " found for " + countryInfo); - } - assertTrue(allPatterns.isEmpty(), "Unrecognized patterns: " + allPatterns + " for" + countryInfo); - } - @ParameterizedTest @MethodSource("ibanRegistryV98SourceExamples") public void exampleAccountsShouldBeValid(String countryName, String example) { @@ -457,4 +437,24 @@ public class IBANValidatorTest { assertTrue(VALIDATOR.hasValidator(iban), "Missing validator: " + iban); assertTrue(VALIDATOR.isValid(iban), iban); } + + @ParameterizedTest + @MethodSource("ibanRegistryV98Source") + public void validatorShouldExistWithProperConfiguration(String countryName, String countryCode, List<String> acountyCode, int ibanLength, String structure) throws Exception { + String countryInfo = " countryCode: " + countryCode + ", countryName: " + countryName; + Validator validator = IBANValidator.getInstance().getValidator(countryCode); + + assertNotNull(validator, "IBAN validator returned null for" + countryInfo); + assertEquals(ibanLength, validator.getIbanLength(), "IBAN length should be " + ibanLength + " for" + countryInfo); + + List<String> allPatterns = Arrays.stream(validator.getRegexValidator().getPatterns()).map(Pattern::pattern).collect( + Collectors.toList()); + + String re = fmtRE(structure.substring(2)); + assertTrue(allPatterns.remove(countryCode + re), "No pattern " + countryCode + re + " found for " + countryInfo); + for (String ac : acountyCode) { + assertTrue(allPatterns.remove(ac + re), "No additional country code " + ac + " found for " + countryInfo); + } + assertTrue(allPatterns.isEmpty(), "Unrecognized patterns: " + allPatterns + " for" + countryInfo); + } }