From b26fc33ebb5525e812b5bebd23a0e4ab253f2180 Mon Sep 17 00:00:00 2001 From: Zipeng WU Date: Mon, 29 Mar 2021 15:50:52 +0200 Subject: SONAR-14642 - SSF-142 --- .../src/test/java/org/sonar/api/utils/text/JsonWriterTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api/src/test/java/org/sonar') 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", "") .endObject().close(); - expect("{\"foo\":\"\"}"); + 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 -- cgit v1.2.3