kwin commented on code in PR #9:
URL: 
https://github.com/apache/sling-org-apache-sling-servlets-get/pull/9#discussion_r1049300282


##########
src/test/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererTest.java:
##########
@@ -197,7 +204,12 @@ public void testBooleansWithTidy() throws IOException {
             "  \"b1\": true,\n" +
             "  \"s2\": \"false\"\n" +
             "  }";
-        assertEquals(expected, getJsonFromRequestResponse());
+        JsonReader jsonReader = Json.createReader(new StringReader(expected));

Review Comment:
   same as above



##########
src/test/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererTest.java:
##########
@@ -182,7 +184,12 @@ public void testNumber() throws IOException {
     public void testBooleansNoTidy() throws IOException {
         context.currentResource("/content/booleans");
         final String expected = 
"{\"b2\":false,\"jcr:primaryType\":\"nt:unstructured\",\"s1\":\"true\",\"b1\":true,\"s2\":\"false\"}";
-        assertEquals(expected, getJsonFromRequestResponse());
+        JsonReader jsonReader = Json.createReader(new StringReader(expected));

Review Comment:
   please use try with resources here.



##########
src/test/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererTest.java:
##########
@@ -182,7 +184,12 @@ public void testNumber() throws IOException {
     public void testBooleansNoTidy() throws IOException {
         context.currentResource("/content/booleans");
         final String expected = 
"{\"b2\":false,\"jcr:primaryType\":\"nt:unstructured\",\"s1\":\"true\",\"b1\":true,\"s2\":\"false\"}";
-        assertEquals(expected, getJsonFromRequestResponse());
+        JsonReader jsonReader = Json.createReader(new StringReader(expected));
+        JsonObject expectedObject = jsonReader.readObject();
+        jsonReader = Json.createReader(new 
StringReader(getJsonFromRequestResponse()));

Review Comment:
   same as above



##########
src/test/java/org/apache/sling/servlets/get/impl/helpers/JsonRendererTest.java:
##########
@@ -197,7 +204,12 @@ public void testBooleansWithTidy() throws IOException {
             "  \"b1\": true,\n" +
             "  \"s2\": \"false\"\n" +
             "  }";
-        assertEquals(expected, getJsonFromRequestResponse());
+        JsonReader jsonReader = Json.createReader(new StringReader(expected));
+        JsonObject expectedObject = jsonReader.readObject();
+        jsonReader = Json.createReader(new 
StringReader(getJsonFromRequestResponse()));

Review Comment:
   same as above



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to