SEC-1317: Forgot to commit test from config module.
This commit is contained in:
parent
02a9db7bcf
commit
ac564fc34e
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue