lukaszlenart commented on code in PR #1782:
URL: https://github.com/apache/struts/pull/1782#discussion_r3577455087


##########
plugins/json/src/test/java/org/apache/struts2/json/JSONInterceptorTest.java:
##########
@@ -905,6 +890,18 @@ public void 
testExcludePropertiesNotAppliedToInputByDefault() throws Exception {
         assertEquals("b", action.getBar());
     }
 
+    public void testObtainsFreshJSONUtilAndReaderPerInvocation() {
+        JSONInterceptor interceptor = new JSONInterceptor();
+        interceptor.setContainer(container); // StrutsTestCase-provided 
container
+
+        JSONUtil first = interceptor.getJSONUtil();
+        JSONUtil second = interceptor.getJSONUtil();
+
+        assertNotSame("interceptor must obtain a fresh JSONUtil per request", 
first, second);
+        assertNotSame("each fresh JSONUtil must carry its own reader (no 
shared parse state)",
+                first.getReader(), second.getReader());
+    }

Review Comment:
   This requires to add getWriter() just for test purpose, useless



-- 
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