### Question:
ServletFilterModuleContainerFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { doFilter((HttpServletRequest) request, (HttpServletResponse) response, chain); }  void init(FilterConfig filterConfig); void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); void destroy();  }### Answer:
@Test public void testFilter() throws IOException, ServletException { when(moduleManager.getFilters(any(FilterLocation.class), eq("/myfilter"), any(FilterConfig.class), eq(FilterDispatcherCondition.REQUEST))).thenReturn(Collections.<Filter>emptyList()); MyFilter filter = new MyFilter(moduleManager); when(request.getContextPath()).thenReturn("/myapp"); when(request.getRequestURI()).thenReturn("/myapp/myfilter"); filter.doFilter(request, response, filterChain); verify(filterChain).doFilter(any(ServletRequest.class), any(ServletResponse.class)); }
@Test public void testNoServletModuleManager() throws IOException, ServletException { MyFilter filter = new MyFilter(null); filter.doFilter(request, response, filterChain); verify(filterChain).doFilter(any(ServletRequest.class), any(ServletResponse.class)); }