SEC-1058: Partial refactoring of AbstractProcessingFilter. It now uses the injected SuccssfulAuthenticationHandler strategy instead of managing everything itself. The default implementation is SavedRequestAwareSuccessfulAuthenticationHandler which encapsulates most of the filter's success logic along with the code which was previously in TargetUrlResolver. Removed TargetUrlResolver.
This commit is contained in:
@@ -4,6 +4,7 @@ import junit.framework.TestCase;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import org.springframework.security.MockAuthenticationManager;
|
||||
import org.springframework.security.ui.SavedRequestAwareAuthenticationSuccessHandler;
|
||||
import org.springframework.security.ui.openid.consumers.MockOpenIDConsumer;
|
||||
import org.springframework.security.util.MockFilterChain;
|
||||
|
||||
@@ -21,7 +22,9 @@ public class OpenIDAuthenticationProcessingFilterTests extends TestCase {
|
||||
protected void setUp() throws Exception {
|
||||
filter = new OpenIDAuthenticationProcessingFilter();
|
||||
filter.setConsumer(new MockOpenIDConsumer(REDIRECT_URL));
|
||||
filter.setDefaultTargetUrl(DEFAULT_TARGET_URL);
|
||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
filter.setSuccessHandler(new SavedRequestAwareAuthenticationSuccessHandler());
|
||||
successHandler.setDefaultTargetUrl(DEFAULT_TARGET_URL);
|
||||
filter.setAuthenticationManager(new MockAuthenticationManager());
|
||||
filter.afterPropertiesSet();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user