private ApplicationImpl mockConfiguration() { ApplicationImpl application = mock(ApplicationImpl.class); ApplicationContextImpl context = mock(ApplicationContextImpl.class); ThemeManager themeManager = mock(ThemeManager.class); when(context.getThemeManager()).thenReturn(themeManager); when(context.getServletContext()).thenReturn(mock(ServletContext.class)); when(application.getApplicationContext()).thenReturn(context); ResourceRegistry resourceRegistry = mock(ResourceRegistry.class); when(context.getResourceRegistry()).thenReturn(resourceRegistry); return application; }
public ClientResources(ApplicationContextImpl applicationContext) { this.applicationContext = applicationContext; resourceManager = applicationContext.getResourceManager(); themeManager = applicationContext.getThemeManager(); }