@Test public void foo() throws IOException, ServletException { RequestEncodingFilter filter = new RequestEncodingFilter(); filter.doFilter(request, response, filterChain); InOrder inOrder = inOrder(request, response, filterChain); inOrder.verify(request).setCharacterEncoding(Charsets.UTF_8.name()); inOrder.verify(response).setCharacterEncoding(Charsets.UTF_8.name()); inOrder.verify(filterChain).doFilter(request, response); }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Charsets.UTF_8.name()); response.setCharacterEncoding(Charsets.UTF_8.name()); chain.doFilter(request, response); }
RequestEncodingFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Charsets.UTF_8.name()); response.setCharacterEncoding(Charsets.UTF_8.name()); chain.doFilter(request, response); } }
RequestEncodingFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Charsets.UTF_8.name()); response.setCharacterEncoding(Charsets.UTF_8.name()); chain.doFilter(request, response); }  }
RequestEncodingFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Charsets.UTF_8.name()); response.setCharacterEncoding(Charsets.UTF_8.name()); chain.doFilter(request, response); }  @Override void init(FilterConfig config); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); }
RequestEncodingFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Charsets.UTF_8.name()); response.setCharacterEncoding(Charsets.UTF_8.name()); chain.doFilter(request, response); }  @Override void init(FilterConfig config); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain);  }