mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 05:09:13 +00:00
MockHttpServletResponse writer sets committed flag
Issue: SPR-16683
This commit is contained in:
+10
@@ -227,6 +227,16 @@ public class MockHttpServletResponseTests {
|
||||
assertEquals(1, response.getContentAsByteArray().length);
|
||||
}
|
||||
|
||||
@Test // SPR-16683
|
||||
public void servletWriterCommittedOnWriterClose() throws IOException {
|
||||
assertFalse(response.isCommitted());
|
||||
response.getWriter().write("X");
|
||||
assertFalse(response.isCommitted());
|
||||
response.getWriter().close();
|
||||
assertTrue(response.isCommitted());
|
||||
assertEquals(1, response.getContentAsByteArray().length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void servletWriterAutoFlushedForString() throws IOException {
|
||||
response.getWriter().write("X");
|
||||
|
||||
Reference in New Issue
Block a user