BAEL-972 - Apache Commons Text - added another example
This commit is contained in:
parent
0dadce5cf7
commit
760d4e1a91
@ -0,0 +1,16 @@
|
||||
package com.baeldung.text;
|
||||
|
||||
import org.apache.commons.text.translate.UnicodeEscaper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class UnicodeEscaperTest {
|
||||
|
||||
@Test
|
||||
public void whenTranslate_thenCorrect() {
|
||||
UnicodeEscaper ue = UnicodeEscaper.above(0);
|
||||
String result = ue.translate("ABCD");
|
||||
|
||||
Assert.assertEquals("\\u0041\\u0042\\u0043\\u0044", result);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user