VelocityRequest extends AbstractViewRequest { public static VelocityRequest createVelocityRequest( ApplicationContext applicationContext, HttpServletRequest request, HttpServletResponse response, Context velocityContext, Writer writer) { DispatchRequest servletRequest = new ServletRequest( applicationContext, request, response); VelocityRequest velocityRequest = new VelocityRequest( servletRequest, velocityContext, writer); return velocityRequest; } VelocityRequest(
            DispatchRequest enclosedRequest, Context ctx, Writer writer); static VelocityRequest createVelocityRequest(
            ApplicationContext applicationContext, HttpServletRequest request,
            HttpServletResponse response, Context velocityContext, Writer writer); @Override List<String> getAvailableScopes(); @Override PrintWriter getPrintWriter(); @Override Writer getWriter(); Map<String, Object> getPageScope(); @Override Map<String, Object> getContext(String scope);  }
@Test public void testCreateVelocityRequest() { HttpServletRequest httpRequest = createMock(HttpServletRequest.class); HttpServletResponse response = createMock(HttpServletResponse.class); ApplicationContext applicationContext = createMock(ApplicationContext.class); replay(velocityContext, httpRequest, response, applicationContext); context = VelocityRequest.createVelocityRequest(applicationContext, httpRequest, response, velocityContext, writer); ServletRequest servletRequest = (ServletRequest) context.getWrappedRequest(); assertEquals(httpRequest, servletRequest.getRequest()); assertEquals(response, servletRequest.getResponse()); verify(velocityContext, httpRequest, response, applicationContext); }