DefaultRequestWrapper implements RequestWrapper { public List<String> getAvailableScopes() { return context.getAvailableScopes(); } DefaultRequestWrapper(Request context); Request getWrappedRequest(); Map<String, String> getHeader(); Map<String, String[]> getHeaderValues(); Addable<String> getResponseHeaders(); ApplicationContext getApplicationContext(); OutputStream getOutputStream(); Writer getWriter(); PrintWriter getPrintWriter(); boolean isResponseCommitted(); Map<String, String> getParam(); Map<String, String[]> getParamValues(); Locale getRequestLocale(); boolean isUserInRole(String role); Map<String, Object> getContext(String scope); List<String> getAvailableScopes();  }
@SuppressWarnings("unchecked") @Test public void testGetAvailableScopes() { Request wrappedRequest = createMockRequest(); Map<String, Object> context = createMock(Map.class); RequestWrapper request = createRequestWrapper(wrappedRequest); String[] scopes = new String[] {"one", "two", "three"}; expect(wrappedRequest.getAvailableScopes()).andReturn(Arrays.asList(scopes)); replay(wrappedRequest, context); assertArrayEquals(scopes, request.getAvailableScopes().toArray()); verify(wrappedRequest, context); }