SEC-1259: Improve consistency of authentication filter names.

This commit is contained in:
Luke Taylor
2009-10-07 14:43:55 +00:00
parent f213cc5d9e
commit 1286741c7c
38 changed files with 268 additions and 297 deletions

View File

@@ -30,7 +30,7 @@ import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.cas.web.CasProcessingFilter;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
@@ -83,7 +83,7 @@ public class CasAuthenticationProviderTests {
cap.afterPropertiesSet();
UsernamePasswordAuthenticationToken token =
new UsernamePasswordAuthenticationToken(CasProcessingFilter.CAS_STATEFUL_IDENTIFIER, "ST-123");
new UsernamePasswordAuthenticationToken(CasAuthenticationFilter.CAS_STATEFUL_IDENTIFIER, "ST-123");
token.setDetails("details");
Authentication result = cap.authenticate(token);
@@ -124,7 +124,7 @@ public class CasAuthenticationProviderTests {
cap.afterPropertiesSet();
UsernamePasswordAuthenticationToken token =
new UsernamePasswordAuthenticationToken(CasProcessingFilter.CAS_STATELESS_IDENTIFIER, "ST-456");
new UsernamePasswordAuthenticationToken(CasAuthenticationFilter.CAS_STATELESS_IDENTIFIER, "ST-456");
token.setDetails("details");
Authentication result = cap.authenticate(token);
@@ -163,7 +163,7 @@ public class CasAuthenticationProviderTests {
cap.afterPropertiesSet();
UsernamePasswordAuthenticationToken token =
new UsernamePasswordAuthenticationToken(CasProcessingFilter.CAS_STATEFUL_IDENTIFIER, "");
new UsernamePasswordAuthenticationToken(CasAuthenticationFilter.CAS_STATEFUL_IDENTIFIER, "");
cap.authenticate(token);
}

View File

@@ -20,22 +20,22 @@ import junit.framework.TestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.cas.web.CasProcessingFilterEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import java.net.URLEncoder;
/**
* Tests {@link CasProcessingFilterEntryPoint}.
* Tests {@link CasAuthenticationEntryPoint}.
*
* @author Ben Alex
* @version $Id$
*/
public class CasProcessingFilterEntryPointTests extends TestCase {
public class CasAuthenticationEntryPointTests extends TestCase {
//~ Methods ========================================================================================================
public void testDetectsMissingLoginFormUrl() throws Exception {
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
ep.setServiceProperties(new ServiceProperties());
try {
@@ -47,7 +47,7 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
}
public void testDetectsMissingServiceProperties() throws Exception {
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
ep.setLoginUrl("https://cas/login");
try {
@@ -59,7 +59,7 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
}
public void testGettersSetters() {
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
ep.setLoginUrl("https://cas/login");
assertEquals("https://cas/login", ep.getLoginUrl());
@@ -72,7 +72,7 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
sp.setSendRenew(false);
sp.setService("https://mycompany.com/bigWebApp/j_spring_cas_security_check");
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
ep.setLoginUrl("https://cas/login");
ep.setServiceProperties(sp);
@@ -94,7 +94,7 @@ public class CasProcessingFilterEntryPointTests extends TestCase {
sp.setSendRenew(true);
sp.setService("https://mycompany.com/bigWebApp/j_spring_cas_security_check");
CasProcessingFilterEntryPoint ep = new CasProcessingFilterEntryPoint();
CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
ep.setLoginUrl("https://cas/login");
ep.setServiceProperties(sp);

View File

@@ -18,7 +18,7 @@ package org.springframework.security.cas.web;
import junit.framework.TestCase;
import org.springframework.security.MockAuthenticationManager;
import org.springframework.security.cas.web.CasProcessingFilter;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
@@ -27,16 +27,16 @@ import org.springframework.mock.web.MockHttpServletResponse;
/**
* Tests {@link CasProcessingFilter}.
* Tests {@link CasAuthenticationFilter}.
*
* @author Ben Alex
* @version $Id$
*/
public class CasProcessingFilterTests extends TestCase {
public class CasAuthenticationFilterTests extends TestCase {
//~ Methods ========================================================================================================
public void testGetters() {
CasProcessingFilter filter = new CasProcessingFilter();
CasAuthenticationFilter filter = new CasAuthenticationFilter();
assertEquals("/j_spring_cas_security_check", filter.getFilterProcessesUrl());
}
@@ -46,7 +46,7 @@ public class CasProcessingFilterTests extends TestCase {
MockAuthenticationManager authMgr = new MockAuthenticationManager(true);
CasProcessingFilter filter = new CasProcessingFilter();
CasAuthenticationFilter filter = new CasAuthenticationFilter();
filter.setAuthenticationManager(authMgr);
Authentication result = filter.attemptAuthentication(request, new MockHttpServletResponse());
@@ -59,7 +59,7 @@ public class CasProcessingFilterTests extends TestCase {
MockAuthenticationManager authMgr = new MockAuthenticationManager(false);
CasProcessingFilter filter = new CasProcessingFilter();
CasAuthenticationFilter filter = new CasAuthenticationFilter();
filter.setAuthenticationManager(authMgr);
try {