1.Now, I have this Response object, and I’m using the Response.getWriter object to write to it and some JSON data.
PrintWriter writer = response.getWriter();
writer.write("hello world");
writer.flush();
2.Because I’m unit testing this code, I need to read the data written to the response. Now that I can get the response object, how do I get the data I just wrote?
I don’t have any way to do it.
New contributor
沐雨听风 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.