-
Dec 14th, 2004, 05:04 AM
#1
MockHttpServletResponse bug?
hello,
I found an issue with MockHttpServletResponse that I believe can be considered as a bug.
When I obtain a PrintWriter from the MockHttpServletResponse using getWriter() method, then a new OutputStreamWriter is created and wrapped inside a PrintWriter. When I write() something to that writer and later in my test use MockHttpServletResponse.getContentAsString() then the content might not yet contain everything I wrote to that PrintWriter because either the PrintWriter or OutputStreamWriter might be buffering their content.
To resolve this I think the getContentAsString() and getContentAsByteArray() should call flushBuffer() first.
best regards,
erik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules