This commit is contained in:
devender.kumar
2019-10-30 23:16:56 +01:00
parent db85c8f275
commit fb34b40870
20538 changed files with 1642819 additions and 0 deletions
@@ -0,0 +1,24 @@
package com.baeldung.text;
import org.apache.commons.text.StrBuilder;
import org.junit.Assert;
import org.junit.Test;
public class StrBuilderUnitTest {
@Test
public void whenReplaced_thenCorrect() {
StrBuilder strBuilder = new StrBuilder("example StrBuilder!");
strBuilder.replaceAll("example", "new");
Assert.assertEquals(new StrBuilder("new StrBuilder!"), strBuilder);
}
@Test
public void whenCleared_thenEmpty() {
StrBuilder strBuilder = new StrBuilder("example StrBuilder!");
strBuilder.clear();
Assert.assertEquals(new StrBuilder(""), strBuilder);
}
}