SEC-1317: Forgot to commit test from config module.

This commit is contained in:
Luke Taylor 2009-12-07 21:39:49 +00:00
parent 02a9db7bcf
commit ac564fc34e
1 changed files with 17 additions and 1 deletions

View File

@ -1131,6 +1131,23 @@ public class HttpSecurityBeanDefinitionParserTests {
AUTH_PROVIDER_XML);
}
@Test
public void httpConfigWithNoAuthProvidersWorksOk() throws Exception {
setContext(
"<http>" +
" <form-login />" +
" <anonymous enabled='false' />" +
"</http>" +
AUTH_PROVIDER_XML);
FilterChainProxy fcp = (FilterChainProxy) appContext.getBean(BeanIds.FILTER_CHAIN_PROXY);
MockHttpServletRequest request = new MockHttpServletRequest("POST", "/j_spring_security_check");
request.setServletPath("/j_spring_security_check");
request.addParameter("j_username", "bob");
request.addParameter("j_password", "bob");
fcp.doFilter(request, new MockHttpServletResponse(), new MockFilterChain());
}
private void setContext(String context) {
appContext = new InMemoryXmlApplicationContext(context);
}
@ -1169,5 +1186,4 @@ public class HttpSecurityBeanDefinitionParserTests {
return ((RememberMeAuthenticationFilter)getFilter(RememberMeAuthenticationFilter.class)).getRememberMeServices();
}
}