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 NumericEntityEscaperTest extends AbstractLangTest {
30
31 @Test
32 public void testAbove() {
33 final NumericEntityEscaper nee = NumericEntityEscaper.above('F');
34
35 final String input = "ADFGZ";
36 final String result = nee.translate(input);
37 assertEquals("ADFGZ", result, "Failed to escape numeric entities via the above method");
38 }
39
40 @Test
41 public void testBelow() {
42 final NumericEntityEscaper nee = NumericEntityEscaper.below('F');
43
44 final String input = "ADFGZ";
45 final String result = nee.translate(input);
46 assertEquals("ADFGZ", result, "Failed to escape numeric entities via the below method");
47 }
48
49 @Test
50 public void testBetween() {
51 final NumericEntityEscaper nee = NumericEntityEscaper.between('F', 'L');
52
53 final String input = "ADFGZ";
54 final String result = nee.translate(input);
55 assertEquals("ADFGZ", result, "Failed to escape numeric entities via the between method");
56 }
57
58
59 @Test
60 public void testSupplementary() {
61 final NumericEntityEscaper nee = new NumericEntityEscaper();
62 final String input = "\uD803\uDC22";
63 final String expected = "𐰢";
64
65 final String result = nee.translate(input);
66 assertEquals(expected, result, "Failed to escape numeric entities supplementary characters");
67
68 }
69
70 }