Results 1 to 2 of 2

Thread: MockHttpServletResponse bug?

  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Default 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

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Please report a bug on JIRA for this issue.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •