2023-04-23 22:45:59 +08:00
|
|
|
package xyz.zhouxy.plusone.commons.function;
|
|
|
|
|
|
2023-06-27 01:09:41 +08:00
|
|
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
|
|
|
|
|
2023-04-30 08:56:27 +08:00
|
|
|
import java.util.Objects;
|
2023-04-23 22:45:59 +08:00
|
|
|
import java.util.function.Predicate;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
|
|
class FunctionTests {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void test() {
|
|
|
|
|
String str = "";
|
2024-03-14 23:18:44 +08:00
|
|
|
Predicate<String> predicate = PredicateTools.<String>from(Objects::nonNull)
|
2023-05-08 21:56:45 +08:00
|
|
|
.and(StringUtils::isNotBlank);
|
2023-06-27 01:09:41 +08:00
|
|
|
assertFalse(predicate.test(str), "校验应是不通过");
|
2023-04-23 22:45:59 +08:00
|
|
|
}
|
|
|
|
|
}
|