Skip to content

Commit b470c14

Browse files
committed
Add test code hasLength() method in StringUtils
1 parent b0c7d15 commit b470c14

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spring-core/src/test/java/org/springframework/util/StringUtilsTests.java

+17
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@
3636
*/
3737
class StringUtilsTests {
3838

39+
@Test
40+
void hasLengthBlank() {
41+
String blank = " ";
42+
assertThat(StringUtils.hasLength(blank)).isTrue();
43+
}
44+
45+
@Test
46+
void hasLengthNullEmpty() {
47+
assertThat(StringUtils.hasLength(null)).isFalse();
48+
assertThat(StringUtils.hasLength("")).isFalse();
49+
}
50+
51+
@Test
52+
void hasLengthValid() {
53+
assertThat(StringUtils.hasLength("t")).isTrue();
54+
}
55+
3956
@Test
4057
void hasTextBlank() {
4158
String blank = " ";

0 commit comments

Comments
 (0)