mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-07 03:02:23 +00:00
Remove dependency on MockAuthenticationManager
This commit is contained in:
parent
930c1b6b53
commit
e94c7739d2
@ -12,9 +12,8 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.mock.web.MockHttpServletRequest;
|
import org.springframework.mock.web.MockHttpServletRequest;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
import org.springframework.security.MockAuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.openid.OpenIDAuthenticationFilter;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.openid.OpenIDConsumerException;
|
|
||||||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||||||
|
|
||||||
public class OpenIDAuthenticationFilterTests {
|
public class OpenIDAuthenticationFilterTests {
|
||||||
@ -33,7 +32,11 @@ public class OpenIDAuthenticationFilterTests {
|
|||||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||||
filter.setAuthenticationSuccessHandler(new SavedRequestAwareAuthenticationSuccessHandler());
|
filter.setAuthenticationSuccessHandler(new SavedRequestAwareAuthenticationSuccessHandler());
|
||||||
successHandler.setDefaultTargetUrl(DEFAULT_TARGET_URL);
|
successHandler.setDefaultTargetUrl(DEFAULT_TARGET_URL);
|
||||||
filter.setAuthenticationManager(new MockAuthenticationManager());
|
filter.setAuthenticationManager(new AuthenticationManager() {
|
||||||
|
public Authentication authenticate(Authentication a) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
});
|
||||||
filter.afterPropertiesSet();
|
filter.afterPropertiesSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user