1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.lang3.text.translate;
19
20 import static org.junit.jupiter.api.Assertions.assertEquals;
21
22 import org.apache.commons.lang3.AbstractLangTest;
23 import org.junit.jupiter.api.Test;
24
25
26
27
28 @Deprecated
29 public class UnicodeEscaperTest extends AbstractLangTest {
30
31 @Test
32 public void testAbove() {
33 final UnicodeEscaper ue = UnicodeEscaper.above('F');
34
35 final String input = "ADFGZ";
36 final String result = ue.translate(input);
37 assertEquals("ADF\\u0047\\u005A", result, "Failed to escape Unicode characters via the above method");
38 }
39
40 @Test
41 public void testBelow() {
42 final UnicodeEscaper ue = UnicodeEscaper.below('F');
43
44 final String input = "ADFGZ";
45 final String result = ue.translate(input);
46 assertEquals("\\u0041\\u0044FGZ", result, "Failed to escape Unicode characters via the below method");
47 }
48
49 @Test
50 public void testBetween() {
51 final UnicodeEscaper ue = UnicodeEscaper.between('F', 'L');
52
53 final String input = "ADFGZ";
54 final String result = ue.translate(input);
55 assertEquals("AD\\u0046\\u0047Z", result, "Failed to escape Unicode characters via the between method");
56 }
57 }