DefaultRequestWrapper implements RequestWrapper { public ApplicationContext getApplicationContext() { return context.getApplicationContext(); } 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 testGetApplicationContext() { Request wrappedRequest = createMockRequest(); ApplicationContext applicationContext = createMock(ApplicationContext.class); expect(wrappedRequest.getApplicationContext()).andReturn(applicationContext); replay(wrappedRequest, applicationContext); RequestWrapper request = createRequestWrapper(wrappedRequest); assertEquals(applicationContext, request.getApplicationContext()); verify(wrappedRequest, applicationContext); }