VelocityRequest extends AbstractViewRequest { @Override public List<String> getAvailableScopes() { return scopes; } 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 testGetAvailableScopes() { DispatchRequest enclosedRequest = createMock(DispatchRequest.class); expect(enclosedRequest.getAvailableScopes()).andReturn(Collections.singletonList("parent")); replay(enclosedRequest); context = new VelocityRequest(enclosedRequest, velocityContext, writer); assertArrayEquals(new String[] {"parent", "page"}, context.getAvailableScopes().toArray()); verify(enclosedRequest); }