升级 Junit5,移除 hutool,使用 commons-lang3。

This commit is contained in:
2023-02-24 09:45:04 +08:00
parent 8545dd714f
commit b6e823a211
3 changed files with 31 additions and 11 deletions

View File

@@ -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<DTO> extends PropertyValidator<DTO, String, StringV
public <E extends RuntimeException> StringValidator<DTO> notBlank(
Function<String, E> exceptionCreator) {
withRule(input -> StrUtil.isNotBlank(input), exceptionCreator);
withRule(StringUtils::isNotBlank, exceptionCreator);
return this;
}

View File

@@ -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" }));