JspRequest extends AbstractViewRequest { public static JspRequest createServletJspRequest(ApplicationContext applicationContext, PageContext pageContext) { return new JspRequest(new ServletRequest( applicationContext, (HttpServletRequest) pageContext .getRequest(), (HttpServletResponse) pageContext .getResponse()), pageContext); } JspRequest(DispatchRequest enclosedRequest,
            PageContext pageContext); static JspRequest createServletJspRequest(ApplicationContext applicationContext, PageContext pageContext); @Override List<String> getAvailableScopes(); @Override PrintWriter getPrintWriter(); @Override Writer getWriter(); Map<String, Object> getPageScope(); Map<String, Object> getRequestScope(); Map<String, Object> getSessionScope(); Map<String, Object> getApplicationScope(); PageContext getPageContext(); @Override Map<String, Object> getContext(String scope);  }
@Test public void testCreateServletJspRequest() { ApplicationContext applicationContext = createMock(ApplicationContext.class); HttpServletRequest servletRequest = createMock(HttpServletRequest.class); HttpServletResponse servletResponse = createMock(HttpServletResponse.class); expect(context.getRequest()).andReturn(servletRequest); expect(context.getResponse()).andReturn(servletResponse); replay(context, applicationContext, servletRequest, servletResponse); JspRequest request = JspRequest.createServletJspRequest(applicationContext, context); ServletRequest wrappedRequest = (ServletRequest) request.getWrappedRequest(); assertEquals(servletRequest, wrappedRequest.getRequest()); assertEquals(servletResponse, wrappedRequest.getResponse()); verify(context, applicationContext, servletRequest, servletResponse); }