diff --git a/pom.xml b/pom.xml index 8c9f4fd..5b572d2 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 xyz.zhouxy.plusone @@ -15,6 +15,7 @@ UTF-8 1.8 1.8 + 3.12.0 @@ -22,17 +23,35 @@ xyz.zhouxy.plusone plusone-commons 0.1.0-SNAPSHOT + + + cn.hutool + hutool-core + + - junit - junit - 4.11 + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.junit.jupiter + junit-jupiter-api + 5.9.2 + test + + + cn.hutool + hutool-core + 5.8.12 test - + + diff --git a/src/main/java/xyz/zhouxy/plusone/validator/StringValidator.java b/src/main/java/xyz/zhouxy/plusone/validator/StringValidator.java index 7e02756..b424c46 100644 --- a/src/main/java/xyz/zhouxy/plusone/validator/StringValidator.java +++ b/src/main/java/xyz/zhouxy/plusone/validator/StringValidator.java @@ -4,7 +4,8 @@ import java.util.List; import java.util.function.Function; import java.util.function.Supplier; -import cn.hutool.core.util.StrUtil; +import org.apache.commons.lang3.StringUtils; + import xyz.zhouxy.plusone.constant.RegexConsts; import xyz.zhouxy.plusone.util.RegexUtil; @@ -108,7 +109,7 @@ public class StringValidator extends PropertyValidator StringValidator notBlank( Function exceptionCreator) { - withRule(input -> StrUtil.isNotBlank(input), exceptionCreator); + withRule(StringUtils::isNotBlank, exceptionCreator); return this; } diff --git a/src/test/java/xyz/zhouxy/plusone/validator/test/BaseValidatorTest.java b/src/test/java/xyz/zhouxy/plusone/validator/test/BaseValidatorTest.java index d9ffe81..92082c0 100644 --- a/src/test/java/xyz/zhouxy/plusone/validator/test/BaseValidatorTest.java +++ b/src/test/java/xyz/zhouxy/plusone/validator/test/BaseValidatorTest.java @@ -4,15 +4,15 @@ import java.util.Arrays; import java.util.List; import java.util.Objects; -import org.junit.Test; +import org.junit.jupiter.api.Test; import xyz.zhouxy.plusone.constant.RegexConsts; import xyz.zhouxy.plusone.validator.BaseValidator; import xyz.zhouxy.plusone.validator.ValidateUtil; -public class BaseValidatorTest { +class BaseValidatorTest { @Test - public void testValidate() { + void testValidate() { RegisterCommand registerCommand = new RegisterCommand("zhouxy108", "luquanlion@outlook.com", "22336", "A1b2C3d4", "A1b2C3d4", Arrays.asList(new String[] { "admin", "editor" }));