|
|
@ -14,6 +14,7 @@ |
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
* limitations under the License. |
|
|
|
* limitations under the License. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.common.utils; |
|
|
|
package org.apache.dolphinscheduler.common.utils; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Assert; |
|
|
|
import org.junit.Assert; |
|
|
@ -61,4 +62,19 @@ public class StringUtilsTest { |
|
|
|
b = StringUtils.isNotBlank("test"); |
|
|
|
b = StringUtils.isNotBlank("test"); |
|
|
|
Assert.assertTrue(b); |
|
|
|
Assert.assertTrue(b); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testreplaceNRTtoUnderline() { |
|
|
|
|
|
|
|
String result1 = StringUtils.replaceNRTtoUnderline("abc\n"); |
|
|
|
|
|
|
|
Assert.assertEquals("abc_", result1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String result2 = StringUtils.replaceNRTtoUnderline("abc\r"); |
|
|
|
|
|
|
|
Assert.assertEquals("abc_", result2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String result3 = StringUtils.replaceNRTtoUnderline("abc\t"); |
|
|
|
|
|
|
|
Assert.assertEquals("abc_", result3); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String result4 = StringUtils.replaceNRTtoUnderline(null); |
|
|
|
|
|
|
|
Assert.assertNull(result4); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|