Assert.notNull(response, "Response must not be null");
if (!(response instanceof OutputStreamHttpServletResponseWrapper))
throw new IllegalArgumentException(
"HtmlMockRequestDispatcher requires OutputStreamHttpServletResponseWrapper");
OutputStreamHttpServletResponseWrapper res =
(OutputStreamHttpServletResponseWrapper)response;
try {
res.getWriter().write(url);
} catch (IOException e) {
e.printStackTrace();
Assert.isTrue(false);
}