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