diff options
author | Zipeng WU <zipeng.wu@sonarsource.com> | 2021-03-29 15:50:52 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-03-31 20:03:47 +0000 |
commit | b26fc33ebb5525e812b5bebd23a0e4ab253f2180 (patch) | |
tree | 810809f9cb0adc2eb9fca974b53cb9492a842a56 /sonar-plugin-api/src/test/java/org/sonar | |
parent | 4e45ff64dd347cc35b4f94933a4961d469654432 (diff) | |
download | sonarqube-b26fc33ebb5525e812b5bebd23a0e4ab253f2180.tar.gz sonarqube-b26fc33ebb5525e812b5bebd23a0e4ab253f2180.zip |
SONAR-14642 - SSF-142
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java index ad523fb74f9..9ae97fcfa35 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/text/JsonWriterTest.java @@ -152,7 +152,15 @@ public class JsonWriterTest { underTest.beginObject() .prop("foo", "<hello \"world\">") .endObject().close(); - expect("{\"foo\":\"<hello \\\"world\\\">\"}"); + expect("{\"foo\":\"\\u003chello \\\"world\\\"\\u003e\"}"); + } + + @Test + public void escape_html_characters() { + underTest.beginObject() + .prop("foo", "123<>abc") + .endObject().close(); + expect("{\"foo\":\"123\\u003c\\u003eabc\"}"); } @Test |