소스 검색

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

Luke Taylor 15 년 전
부모
커밋
ac564fc34e
1개의 변경된 파일17개의 추가작업 그리고 1개의 파일을 삭제
  1. 17 1
      config/src/test/java/org/springframework/security/config/http/HttpSecurityBeanDefinitionParserTests.java

+ 17 - 1
config/src/test/java/org/springframework/security/config/http/HttpSecurityBeanDefinitionParserTests.java

@@ -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();
     }
 
-
 }