@Test public void testDoFilterInternal_normal() throws ServletException, IOException { MDC.put("key0", "value0"); testTarget.doFilterInternal(mockRequest, mockResponse, mockFilterChain); assertThat(mockFilterChain.actualMdcContextMap.size(), is(1)); assertThat(mockFilterChain.actualMdcContextMap.containsKey("key0"), is( true)); assertThat(MDC.getCopyOfContextMap(), is(nullValue())); }
@Override protected final void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { filterChain.doFilter(request, response); } finally { MDC.clear(); } }
MDCClearFilter extends OncePerRequestFilter { @Override protected final void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { filterChain.doFilter(request, response); } finally { MDC.clear(); } } }
MDCClearFilter extends OncePerRequestFilter { @Override protected final void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { filterChain.doFilter(request, response); } finally { MDC.clear(); } }  }
MDCClearFilter extends OncePerRequestFilter { @Override protected final void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { filterChain.doFilter(request, response); } finally { MDC.clear(); } }   }
MDCClearFilter extends OncePerRequestFilter { @Override protected final void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { filterChain.doFilter(request, response); } finally { MDC.clear(); } }    }