request.setMethod("POST");
request.setQueryString("a&b=&c=1&c=2");
request.setContentType(WebSphereParametersFilter.CONTENT_TYPE_WWW_FORM_URLENCODED);
request.setContent("d&e=&f=1&f=2".getBytes());
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain chain = new MockFilterChain();
// test query parameters before parsing
assertEquals("Query parameters are not empty before parsing", 0, request.getParameterMap()
.size());
// invoke filter
new WebSphereParametersFilter().doFilter(request, response, chain);
// test query and POST parameters
assertEquals("There are not 6 query parameters", 6, chain.getRequest().getParameterMap()
.size());
assertParameters(chain.getRequest(), "a", "b", "c");
assertParameters(chain.getRequest(), "d", "e", "f");
}