joerghoh commented on code in PR #57:
URL: 
https://github.com/apache/sling-org-apache-sling-engine/pull/57#discussion_r1985561195


##########
src/test/java/org/apache/sling/engine/impl/SlingHttpServletResponseImplTest.java:
##########
@@ -86,6 +88,24 @@ public class SlingHttpServletResponseImplTest {
         "4749 LOG Adding bindings took 4 microseconds"
     };
 
+    @Test
+    public void testNoViolationChecksOnCommitedResponse() throws IOException {
+        final SlingHttpServletResponse orig = 
Mockito.mock(SlingHttpServletResponse.class);
+        Mockito.when(orig.isCommitted()).thenReturn(true);
+
+        final RequestData requestData = mock(RequestData.class);
+        final DispatchingInfo info = new 
DispatchingInfo(DispatcherType.INCLUDE);
+        when(requestData.getDispatchingInfo()).thenReturn(info);
+        info.setProtectHeadersOnInclude(true);
+
+        final SlingHttpServletResponseImpl include = new 
SlingHttpServletResponseImpl(requestData, orig);
+        SlingHttpServletResponseImpl spyInclude = spy(include);
+
+        spyInclude.setContentType("someOtherType");
+        Mockito.verify(orig, atLeastOnce()).setContentType(Mockito.any());

Review Comment:
   why ``atLeastOnce()``? I assume that we can make a clear statement, how many 
times it was actually called.



-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to