@Test public void notWrapGetRequests() throws Exception { request.setMethod("GET"); filter.doFilter(request, response, filterChain); verify(filterChain).doFilter(eq(request), eq(response)); }
@Test public void wrapPostRequestsWithoutContentType() throws Exception { request.setMethod("POST"); request.setContent(new byte[0]); filter.doFilter(request, response, filterChain); verify(filterChain).doFilter(any(FormEncodedHttpServletRequestWrapper.class), eq(response)); }
@Test public void notWrapPostRequestsWithContentType() throws Exception { request.setMethod("POST"); request.addHeader(CONTENT_TYPE, ANY_TYPE); filter.doFilter(request, response, filterChain); verify(filterChain).doFilter(eq(request), eq(response)); }