@Test public void shouldReloadWhenRequestHasReloadParameter() throws ServletException, IOException { filterInit(); when(mockRequest.getRemoteAddr()).thenReturn(FakeIpBlocker.ALLOW_IP); filter.doFilter(mockRequest, mockResponse, mockFilterChain); assertFalse(FakeIpBlocker.reloaded); when(mockRequest.getParameter("IBFRM")).thenReturn("true"); filter.doFilter(mockRequest, mockResponse, mockFilterChain); assertTrue(FakeIpBlocker.reloaded); }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (ipBlocker.accept(request.getRemoteAddr())) processDoFilter(request, response, chain); else sendNotFoundResponse((HttpServletResponse) response); }
IpBlockFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (ipBlocker.accept(request.getRemoteAddr())) processDoFilter(request, response, chain); else sendNotFoundResponse((HttpServletResponse) response); } }
IpBlockFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (ipBlocker.accept(request.getRemoteAddr())) processDoFilter(request, response, chain); else sendNotFoundResponse((HttpServletResponse) response); }  }
IpBlockFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (ipBlocker.accept(request.getRemoteAddr())) processDoFilter(request, response, chain); else sendNotFoundResponse((HttpServletResponse) response); }  @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); @Override void destroy(); }
IpBlockFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (ipBlocker.accept(request.getRemoteAddr())) processDoFilter(request, response, chain); else sendNotFoundResponse((HttpServletResponse) response); }  @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); @Override void destroy(); static final String RELOAD_COMMAND_PARAM_NAME_CONFIG_NAME; static final String DEFAULT_RELOAD_COMMAND_PARAM_NAME_VALUE; }