@Test public void lazyInitTest() throws Exception { LazyDelegateFilter<Filter> delegateFilter = spy(new LazyDelegateFilter<Filter>(filterMock.getClass())); delegateFilter.init(filterConfigMock); doReturn(filterMock).when(delegateFilter).createNewFilterInstance(); delegateFilter.lazyInit(); verify(filterMock).init(filterConfigMock); }
public void lazyInit() { try { delegate = createNewFilterInstance(); if (initHook != null) { initHook.init(delegate); } delegate.init(filterConfig); } catch (Exception e) { throw new RuntimeException(e); } }
LazyDelegateFilter implements Filter { public void lazyInit() { try { delegate = createNewFilterInstance(); if (initHook != null) { initHook.init(delegate); } delegate.init(filterConfig); } catch (Exception e) { throw new RuntimeException(e); } } }
LazyDelegateFilter implements Filter { public void lazyInit() { try { delegate = createNewFilterInstance(); if (initHook != null) { initHook.init(delegate); } delegate.init(filterConfig); } catch (Exception e) { throw new RuntimeException(e); } } LazyDelegateFilter(Class<? extends T> delegateClass); }
LazyDelegateFilter implements Filter { public void lazyInit() { try { delegate = createNewFilterInstance(); if (initHook != null) { initHook.init(delegate); } delegate.init(filterConfig); } catch (Exception e) { throw new RuntimeException(e); } } LazyDelegateFilter(Class<? extends T> delegateClass); void lazyInit(); @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); @Override void destroy(); InitHook<T> getInitHook(); void setInitHook(InitHook<T> initHook); Class<? extends T> getDelegateClass(); }
LazyDelegateFilter implements Filter { public void lazyInit() { try { delegate = createNewFilterInstance(); if (initHook != null) { initHook.init(delegate); } delegate.init(filterConfig); } catch (Exception e) { throw new RuntimeException(e); } } LazyDelegateFilter(Class<? extends T> delegateClass); void lazyInit(); @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); @Override void destroy(); InitHook<T> getInitHook(); void setInitHook(InitHook<T> initHook); Class<? extends T> getDelegateClass();  }