DefaultRequestWrapper implements RequestWrapper { public Map<String, Object> getContext(String scope) { return context.getContext(scope); } 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 testGetContext() { Request wrappedRequest = createMockRequest(); Map<String, Object> context = createMock(Map.class); RequestWrapper request = createRequestWrapper(wrappedRequest); expect(wrappedRequest.getContext("one")).andReturn(context); replay(wrappedRequest, context); assertEquals(context, request.getContext("one")); verify(wrappedRequest, context); }