VelocityRequest extends AbstractViewRequest { public Map<String, Object> getPageScope() { if (pageScope == null) { pageScope = new VelocityScopeMap(ctx); } return pageScope; } 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 testGetPageScope() { DispatchRequest enclosedRequest = createMock(DispatchRequest.class); expect(enclosedRequest.getAvailableScopes()).andReturn(Collections.singletonList("parent")); replay(velocityContext, enclosedRequest); context = new VelocityRequest(enclosedRequest, velocityContext, writer); assertTrue(context.getPageScope() instanceof VelocityScopeMap); verify(velocityContext, enclosedRequest); }