From e94c7739d2cd94ad6d721b67123e34df5c8aacd5 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Wed, 14 Oct 2009 22:14:01 +0000 Subject: [PATCH] Remove dependency on MockAuthenticationManager --- .../openid/OpenIDAuthenticationFilterTests.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openid/src/test/java/org/springframework/security/openid/OpenIDAuthenticationFilterTests.java b/openid/src/test/java/org/springframework/security/openid/OpenIDAuthenticationFilterTests.java index d169536bdd..ee7e2aa837 100644 --- a/openid/src/test/java/org/springframework/security/openid/OpenIDAuthenticationFilterTests.java +++ b/openid/src/test/java/org/springframework/security/openid/OpenIDAuthenticationFilterTests.java @@ -12,9 +12,8 @@ import org.junit.Before; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.security.MockAuthenticationManager; -import org.springframework.security.openid.OpenIDAuthenticationFilter; -import org.springframework.security.openid.OpenIDConsumerException; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; public class OpenIDAuthenticationFilterTests { @@ -33,7 +32,11 @@ public class OpenIDAuthenticationFilterTests { SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); filter.setAuthenticationSuccessHandler(new SavedRequestAwareAuthenticationSuccessHandler()); successHandler.setDefaultTargetUrl(DEFAULT_TARGET_URL); - filter.setAuthenticationManager(new MockAuthenticationManager()); + filter.setAuthenticationManager(new AuthenticationManager() { + public Authentication authenticate(Authentication a) { + return a; + } + }); filter.afterPropertiesSet(); }