request.setMethod("POST");
request.setupAddParameter(config.getUsernameParameterName(), GeoServerUser.ROOT_USERNAME);
request.setupAddParameter(config.getPasswordParameterName(), "geoserver1");
getProxy().doFilter(request, response, chain);
assertEquals(HttpServletResponse.SC_OK, response.getErrorCode());
assertTrue(response.wasRedirectSent());
assertTrue(response.getHeader("Location").endsWith(GeoServerUserNamePasswordAuthenticationFilter.URL_LOGIN_FAILURE));
ctx = (SecurityContext)request.getSession(true).getAttribute(
HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY);
assertNull(ctx);
assertNull(SecurityContextHolder.getContext().getAuthentication());