PentahoPathDecodingFilter implements Filter { @Override public void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain ) throws IOException, ServletException { EncodingAwareHttpServletRequestWrapper wrapper = new EncodingAwareHttpServletRequestWrapper( (HttpServletRequest) servletRequest ); filterChain.doFilter( wrapper, servletResponse ); }  @Override void init( FilterConfig filterConfig ); @Override void doFilter( ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain ); @Override void destroy();  }
@Test public void testDoFilter() throws Exception { PentahoPathDecodingFilter decodingFilter = new PentahoPathDecodingFilter(); final MockHttpServletRequest request = new MockHttpServletRequest( "GET", "http: request.setPathInfo( "/pentaho/encoded%5Cpath" ); decodingFilter.doFilter( request, new MockHttpServletResponse(), new MockFilterChain() { @Override public void doFilter( ServletRequest request, ServletResponse response ) { assertEquals( "/pentaho/encoded\\path", ( (HttpServletRequest) request ).getPathInfo() ); assertEquals( "http: } } ); }