Skip to content

Commit c499ece

Browse files
Ahmed Tawilapivovarit
authored andcommitted
BAEL-972 - Apache Commons Text (eugenp#2186)
* 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 * BAEL-972 - Apache Commons Text - added another example
1 parent ac8e04b commit c499ece

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.baeldung.text;
2+
3+
import org.apache.commons.text.translate.UnicodeEscaper;
4+
import org.junit.Assert;
5+
import org.junit.Test;
6+
7+
public class UnicodeEscaperTest {
8+
9+
@Test
10+
public void whenTranslate_thenCorrect() {
11+
UnicodeEscaper ue = UnicodeEscaper.above(0);
12+
String result = ue.translate("ABCD");
13+
14+
Assert.assertEquals("\\u0041\\u0042\\u0043\\u0044", result);
15+
}
16+
}

0 commit comments

Comments
 (0)