BaseAuthFilter extends ModalityFilter { protected void processProtectedRequest(USER logged, HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException { if (logger.isDebugEnabled()) { String characterEncoding = Optional.ofNullable(request.getCharacterEncoding()).orElse("utf-8"); logger.debug("user '{}' going towards {}", displayUser(logged), URLDecoder.decode(request.getRequestURI(), characterEncoding)); } filterChain.doFilter(request, response); }  @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain); @Override void destroy(); static final String REALM; static final String PROTECTED_RESOURCES; static final String PUBLIC_RESOURCES; }
@Test public void processProtectedRequest() throws Exception { recordConfig(); expect(request.getRequestURI()).andAnswer(eval("/some-uri")); expect(request.getParameter("Good-Login")).andAnswer(eval("Nestor")); expect(request.getCharacterEncoding()).andAnswer(eval("utf-8")); expect(request.getRequestURI()).andAnswer(eval("/some-uri")); filterChain.doFilter(request, response); replayAll(); authFilter = new AuthFilter(); authFilter.init(filterConfig); authFilter.doFilter(request, response, filterChain); }