|
| 1 | +package org.utplsql.maven.plugin.util; |
| 2 | + |
| 3 | +import org.junit.jupiter.api.Test; |
| 4 | + |
| 5 | +import static org.junit.jupiter.api.Assertions.assertFalse; |
| 6 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
| 7 | +import static org.utplsql.maven.plugin.util.StringUtil.isBlank; |
| 8 | +import static org.utplsql.maven.plugin.util.StringUtil.isEmpty; |
| 9 | +import static org.utplsql.maven.plugin.util.StringUtil.isNotBlank; |
| 10 | +import static org.utplsql.maven.plugin.util.StringUtil.isNotEmpty; |
| 11 | + |
| 12 | +class StringUtilTest { |
| 13 | + |
| 14 | + @Test |
| 15 | + void isEmpty_with_empty() { |
| 16 | + assertTrue(isEmpty("")); |
| 17 | + } |
| 18 | + |
| 19 | + @Test |
| 20 | + void isEmpty_with_null() { |
| 21 | + assertTrue(isEmpty(null)); |
| 22 | + } |
| 23 | + |
| 24 | + @Test |
| 25 | + void isEmpty_with_string() { |
| 26 | + assertFalse(isEmpty("abc")); |
| 27 | + } |
| 28 | + |
| 29 | + @Test |
| 30 | + void isNotEmpty_with_string() { |
| 31 | + assertTrue(isNotEmpty("abc")); |
| 32 | + } |
| 33 | + |
| 34 | + @Test |
| 35 | + void isNotEmpty_with_empty() { |
| 36 | + assertFalse(isNotEmpty("")); |
| 37 | + } |
| 38 | + |
| 39 | + @Test |
| 40 | + void isNotEmpty_with_blank() { |
| 41 | + assertTrue(isNotEmpty(" ")); |
| 42 | + } |
| 43 | + |
| 44 | + @Test |
| 45 | + void isBlank_with_blank() { |
| 46 | + assertTrue(isBlank(" ")); |
| 47 | + } |
| 48 | + |
| 49 | + @Test |
| 50 | + void isBlank_with_null() { |
| 51 | + assertTrue(isBlank(null)); |
| 52 | + } |
| 53 | + |
| 54 | + @Test |
| 55 | + void isBlank_with_string() { |
| 56 | + assertFalse(isBlank("abc")); |
| 57 | + } |
| 58 | + |
| 59 | + @Test |
| 60 | + void isBlank_with_whitespaces_before_string() { |
| 61 | + assertFalse(isBlank(" abc")); |
| 62 | + } |
| 63 | + |
| 64 | + @Test |
| 65 | + void isNotBlank_with_string() { |
| 66 | + assertTrue(isNotBlank("abc")); |
| 67 | + } |
| 68 | + |
| 69 | + @Test |
| 70 | + void isNotBlank_with_empty() { |
| 71 | + assertFalse(isNotBlank("")); |
| 72 | + } |
| 73 | +} |
0 commit comments