class BaseAuthFilter extends ModalityFilter {

    protected void processProtectedRequest(USER logged, HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException
    {
        if (logger.isDebugEnabled())
        {
            // CB TODO - other uris logging should decode uris
            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);
    }

}

class BaseAuthFilterTest extends ModalityFilter {

    private AuthFilter authFilter;

    @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);
    }

}