Prechádzať zdrojové kódy

SEC-1399: Remove MockAuthenticationManager in app context file for FilterChainProxy tests.

Luke Taylor 15 rokov pred
rodič
commit
26cf6f5528

+ 9 - 3
config/src/test/resources/org/springframework/security/util/filtertest-valid.xml

@@ -31,11 +31,17 @@ http://www.springframework.org/schema/security http://www.springframework.org/sc
     <bean id="sif" class="org.springframework.security.web.context.SecurityContextPersistenceFilter"/>
     <bean id="sif" class="org.springframework.security.web.context.SecurityContextPersistenceFilter"/>
 
 
     <bean id="apf" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
     <bean id="apf" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
-       <property name="authenticationManager">
-           <bean class="org.springframework.security.MockAuthenticationManager"/>
-       </property>
+       <property name="authenticationManager" ref="authenticationManager"/>
     </bean>
     </bean>
 
 
+    <sec:authentication-manager alias="authenticationManager">
+        <sec:authentication-provider>
+            <sec:user-service>
+                <sec:user name="jemima" password="password" authorities="A"/>
+            </sec:user-service>
+        </sec:authentication-provider>
+    </sec:authentication-manager>
+
     <bean id="mockNotAFilter" class="org.springframework.security.web.util.AntUrlPathMatcher"/>
     <bean id="mockNotAFilter" class="org.springframework.security.web.util.AntUrlPathMatcher"/>
 
 
     <bean id="filterChain" class="org.springframework.security.web.FilterChainProxy">
     <bean id="filterChain" class="org.springframework.security.web.FilterChainProxy">