You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assertThat(unescaped).isEqualTo("\"This is a quote'");
46
-
}
47
-
48
-
@Test
49
-
voidtestEncodeIntoHtmlCharacterSet() {
44
+
voidhtmlEscapeIntoHtmlCharacterSet() {
50
45
assertThat(HtmlUtils.htmlEscape("")).as("An empty string should be converted to an empty string").isEmpty();
51
46
assertThat(HtmlUtils.htmlEscape("A sentence containing no special characters.")).as("A string containing no special characters should not be affected").isEqualTo("A sentence containing no special characters.");
assertThat(HtmlUtils.htmlEscapeDecimal("" + (char) 977)).as("The special character 977 should be encoded to 'ϑ'").isEqualTo("ϑ");
61
56
}
62
57
63
-
// SPR-9293
64
-
@Test
65
-
voidtestEncodeIntoHtmlCharacterSetFromUtf8() {
58
+
@Test// SPR-9293
59
+
voidhtmlEscapeIntoHtmlCharacterSetFromUtf8() {
66
60
Stringutf8 = ("UTF-8");
67
-
assertThat(HtmlUtils.htmlEscape("", utf8)).as("An empty string should be converted to an empty string")
68
-
.isEmpty();
61
+
62
+
assertThat(HtmlUtils.htmlEscape("", utf8)).as("An empty string should be converted to an empty string").isEmpty();
69
63
assertThat(HtmlUtils.htmlEscape("A sentence containing no special characters.")).as("A string containing no special characters should not be affected").isEqualTo("A sentence containing no special characters.");
70
64
71
65
assertThat(HtmlUtils.htmlEscape("< >", utf8)).as("'< >' should be encoded to '< >'").isEqualTo("< >");
assertThat(actualOutput).as("Basic HTML entities were not unescaped correctly.").isEqualTo(expectedOutput);
100
+
}
101
+
102
+
@Test
103
+
voidhtmlUnescapeFromHtmlCharacterSet() {
79
104
assertThat(HtmlUtils.htmlUnescape("")).as("An empty string should be converted to an empty string").isEmpty();
80
105
assertThat(HtmlUtils.htmlUnescape("This is a sentence containing no special characters.")).as("A string containing no special characters should not be affected").isEqualTo("This is a sentence containing no special characters.");
0 commit comments