Minor tidying up.

This commit is contained in:
Luke Taylor 2008-12-02 12:53:48 +00:00
parent f3387cd879
commit 283b932fe0
1 changed files with 39 additions and 39 deletions

View File

@ -15,23 +15,8 @@
package org.springframework.security.ui; package org.springframework.security.ui;
import junit.framework.TestCase; import java.io.IOException;
import org.springframework.security.AccountExpiredException; import java.util.Properties;
import org.springframework.security.Authentication;
import org.springframework.security.AuthenticationException;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.GrantedAuthorityImpl;
import org.springframework.security.MockAuthenticationManager;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.security.ui.rememberme.NullRememberMeServices;
import org.springframework.security.ui.rememberme.TokenBasedRememberMeServices;
import org.springframework.security.ui.savedrequest.SavedRequest;
import org.springframework.security.util.PortResolverImpl;
import org.springframework.mock.web.MockFilterConfig;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import javax.servlet.Filter; import javax.servlet.Filter;
import javax.servlet.FilterChain; import javax.servlet.FilterChain;
@ -42,8 +27,24 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Properties; import junit.framework.TestCase;
import org.springframework.mock.web.MockFilterConfig;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.AccountExpiredException;
import org.springframework.security.Authentication;
import org.springframework.security.AuthenticationException;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.MockAuthenticationManager;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
import org.springframework.security.ui.rememberme.NullRememberMeServices;
import org.springframework.security.ui.rememberme.TokenBasedRememberMeServices;
import org.springframework.security.ui.savedrequest.SavedRequest;
import org.springframework.security.util.AuthorityUtils;
import org.springframework.security.util.PortResolverImpl;
/** /**
@ -591,8 +592,7 @@ public class AbstractProcessingFilterTests extends TestCase {
public Authentication attemptAuthentication(HttpServletRequest request) throws AuthenticationException { public Authentication attemptAuthentication(HttpServletRequest request) throws AuthenticationException {
if (grantAccess) { if (grantAccess) {
return new UsernamePasswordAuthenticationToken("test", "test", return new UsernamePasswordAuthenticationToken("test", "test", AuthorityUtils.createAuthorityList("TEST"));
new GrantedAuthority[] {new GrantedAuthorityImpl("TEST")});
} else { } else {
throw exceptionToThrow; throw exceptionToThrow;
} }