Files
spring-boot-rest/libraries/src/test/java/com/baeldung/text/StrBuilderTest.java
Ahmed Tawila c2574997f7 BAEL-972 - Apache Commons Text (#2178)
* Evaluation article: Different Types of Bean Injection in Spring

* added tests & changed configuration to Java-based config

* removed xml config files

* rename unit tests

* BAEL-972 - Apache Commons Text

* remove code from evaluation article

* remove code from evaluation article
2017-06-30 17:00:18 +02:00

25 lines
655 B
Java

package com.baeldung.text;
import org.apache.commons.text.StrBuilder;
import org.junit.Assert;
import org.junit.Test;
public class StrBuilderTest {
@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);
}
}