DefaultRequestWrapper implements RequestWrapper { public boolean isUserInRole(String role) { return context.isUserInRole(role); } 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();  }
@Test public void testIsUserInRole() { Request wrappedRequest = createMockRequest(); expect(wrappedRequest.isUserInRole("myrole")).andReturn(Boolean.TRUE); replay(wrappedRequest); RequestWrapper request = createRequestWrapper(wrappedRequest); assertTrue(request.isUserInRole("myrole")); verify(wrappedRequest); }