@Test public void getInitHookWithResourceLoaderDependingInitHook() { LazyInitRegistration.APPLICATION_CONTEXT = applicationContextMock; when(applicationContextMock.containsBean(LazyInitRegistration.RESOURCE_LOADER_DEPENDING_INIT_HOOK)).thenReturn(true); when(applicationContextMock.getBean(LazyInitRegistration.RESOURCE_LOADER_DEPENDING_INIT_HOOK, InitHook.class)).thenReturn(initHookMock); assertEquals(initHookMock, LazyInitRegistration.getInitHook()); }
@SuppressWarnings("unchecked") protected static <T extends Filter> InitHook<T> getInitHook() { if (APPLICATION_CONTEXT != null && APPLICATION_CONTEXT.containsBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK)) { return APPLICATION_CONTEXT.getBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK, InitHook.class); } return null; }
LazyInitRegistration implements ApplicationContextAware { @SuppressWarnings("unchecked") protected static <T extends Filter> InitHook<T> getInitHook() { if (APPLICATION_CONTEXT != null && APPLICATION_CONTEXT.containsBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK)) { return APPLICATION_CONTEXT.getBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK, InitHook.class); } return null; } }
LazyInitRegistration implements ApplicationContextAware { @SuppressWarnings("unchecked") protected static <T extends Filter> InitHook<T> getInitHook() { if (APPLICATION_CONTEXT != null && APPLICATION_CONTEXT.containsBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK)) { return APPLICATION_CONTEXT.getBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK, InitHook.class); } return null; }  }
LazyInitRegistration implements ApplicationContextAware { @SuppressWarnings("unchecked") protected static <T extends Filter> InitHook<T> getInitHook() { if (APPLICATION_CONTEXT != null && APPLICATION_CONTEXT.containsBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK)) { return APPLICATION_CONTEXT.getBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK, InitHook.class); } return null; }  @Override void setApplicationContext(ApplicationContext applicationContext); }
LazyInitRegistration implements ApplicationContextAware { @SuppressWarnings("unchecked") protected static <T extends Filter> InitHook<T> getInitHook() { if (APPLICATION_CONTEXT != null && APPLICATION_CONTEXT.containsBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK)) { return APPLICATION_CONTEXT.getBean(RESOURCE_LOADER_DEPENDING_INIT_HOOK, InitHook.class); } return null; }  @Override void setApplicationContext(ApplicationContext applicationContext);  }