HttpResponseWrapper extends HttpServletResponseWrapper implements ResponseWithSessionId { @Override public final void sendRedirect(String location) throws IOException { request.propagateSession(); super.sendRedirect(location); closeOutput(); } HttpResponseWrapper(HttpRequestWrapper request, HttpServletResponse response); @Override final void sendError(int sc); @Override final void sendError(int sc, String msg); @Override final void sendRedirect(String location); @Override SaveSessionServletOutputStream getOutputStream(); @Override PrintWriter getWriter(); @Override void addHeader(String name, String value); @Override void setHeader(String name, String value); @Override void setContentLength(int len); @Override void reset(); @Override String encodeURL(String url); @Override void flushBuffer();  }
@Test public void testPropagateOnSendRedirectString() throws IOException { responseWrapper.sendRedirect("test"); verify(response).sendRedirect("test"); verify(requestWrapper).propagateSession(); }