ApplicationContextWrapper implements ApplicationContext { public ApplicationResource getResource(String localePath) { return context.getResource(localePath); } ApplicationContextWrapper(ApplicationContext context); ApplicationContext getWrappedApplicationContext(); Map<String, Object> getApplicationScope(); Object getContext(); Map<String, String> getInitParams(); ApplicationResource getResource(String localePath); ApplicationResource getResource(ApplicationResource base, Locale locale); Collection<ApplicationResource> getResources(String path);  }
@Test public void testGetResource() throws IOException { ApplicationContext wrappedContext = createMock(ApplicationContext.class); ApplicationResource obj = createMock(ApplicationResource.class); ApplicationResource objFr = createMock(ApplicationResource.class); expect(wrappedContext.getResource("whatever.html")).andReturn(obj); expect(wrappedContext.getResource(obj, Locale.FRENCH)).andReturn(objFr); replay(wrappedContext); ApplicationContextWrapper wrapper = new ApplicationContextWrapper(wrappedContext); assertEquals(obj, wrapper.getResource("whatever.html")); assertEquals(objFr, wrapper.getResource(obj, Locale.FRENCH)); verify(wrappedContext); }