@Test public void doFilterTest() throws Exception { LazyDelegateFilter<Filter> delegateFilter = new LazyDelegateFilter<Filter>(filterMock.getClass()); delegateFilter.delegate = filterMock; ServletRequest request = mock(ServletRequest.class); ServletResponse response = mock(ServletResponse.class); FilterChain chain = mock(FilterChain.class); delegateFilter.doFilter(request, response, chain); verify(filterMock).doFilter(request, response, chain); }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { delegate.doFilter(request, response, chain); }
LazyDelegateFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { delegate.doFilter(request, response, chain); } }
LazyDelegateFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { delegate.doFilter(request, response, chain); } LazyDelegateFilter(Class<? extends T> delegateClass); }
LazyDelegateFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { delegate.doFilter(request, response, chain); } 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 { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { delegate.doFilter(request, response, chain); } 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();  }