renamed to remove "Cas" from names since its in th CAS package
This commit is contained in:
parent
a862741129
commit
e9467826ae
|
|
@ -9,17 +9,17 @@ import junit.framework.TestCase;
|
|||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
|
||||
/**
|
||||
* Abstract test for all CasAuthorizedDecider implementations.
|
||||
* Abstract test for all AuthorizedDecider implementations.
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public abstract class AbstractCasAuthorizedDeciderTests extends TestCase {
|
||||
public abstract class AbstractAuthorizedDeciderTests extends TestCase {
|
||||
|
||||
private CasAuthorizedDecider casAuthorizedDecider;
|
||||
private AuthorizedDecider casAuthorizedDecider;
|
||||
|
||||
protected abstract CasAuthorizedDecider getCasAuthorizedDeciderImpl();
|
||||
protected abstract AuthorizedDecider getCasAuthorizedDeciderImpl();
|
||||
|
||||
protected final void setUp() throws Exception {
|
||||
this.casAuthorizedDecider = getCasAuthorizedDeciderImpl();
|
||||
|
|
@ -8,14 +8,14 @@ package org.jasig.cas.client.authorization;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class DefaultCasAuthorizedDeciderImplTests extends
|
||||
AbstractCasAuthorizedDeciderTests {
|
||||
public final class DefaultAuthorizedDeciderImplTests extends
|
||||
AbstractAuthorizedDeciderTests {
|
||||
|
||||
public CasAuthorizedDecider getCasAuthorizedDeciderImpl() {
|
||||
public AuthorizedDecider getCasAuthorizedDeciderImpl() {
|
||||
final List list = new ArrayList();
|
||||
list.add("scott");
|
||||
|
||||
final DefaultCasAuthorizedDeciderImpl impl = new DefaultCasAuthorizedDeciderImpl(list);
|
||||
final DefaultAuthorizedDeciderImpl impl = new DefaultAuthorizedDeciderImpl(list);
|
||||
return impl;
|
||||
}
|
||||
|
||||
|
|
@ -21,22 +21,22 @@ import java.io.IOException;
|
|||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* Tests for the CasAuthenticationFilter.
|
||||
* Tests for the AuthenticationFilter.
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasAuthenticationFilterTests extends TestCase {
|
||||
public final class AuthenticationFilterTests extends TestCase {
|
||||
|
||||
private static final String CAS_SERVICE_URL = "https://localhost:8443/service";
|
||||
|
||||
private static final String CAS_LOGIN_URL = "https://localhost:8443/cas/login";
|
||||
|
||||
private CasAuthenticationFilter filter;
|
||||
private AuthenticationFilter filter;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.filter = new CasAuthenticationFilter(null, CAS_SERVICE_URL, CAS_LOGIN_URL, false, false);
|
||||
this.filter = new AuthenticationFilter(null, CAS_SERVICE_URL, CAS_LOGIN_URL, false, false);
|
||||
this.filter.init(new MockFilterConfig());
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
};
|
||||
|
||||
request.setSession(session);
|
||||
this.filter = new CasAuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, false, false);
|
||||
this.filter = new AuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, false, false);
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
|
||||
assertEquals(CAS_LOGIN_URL
|
||||
|
|
@ -122,7 +122,7 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
}
|
||||
};
|
||||
|
||||
this.filter = new CasAuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, true, false);
|
||||
this.filter = new AuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, true, false);
|
||||
request.setSession(session);
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ public final class CasAuthenticationFilterTests extends TestCase {
|
|||
};
|
||||
|
||||
request.setSession(session);
|
||||
this.filter = new CasAuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, true, true);
|
||||
this.filter = new AuthenticationFilter("localhost:8443", null, CAS_LOGIN_URL, true, true);
|
||||
this.filter.doFilter(request, response, filterChain);
|
||||
assertNotNull(session.getAttribute(AbstractCasFilter.CONST_GATEWAY));
|
||||
assertNotNull(response.getRedirectedUrl());
|
||||
|
|
@ -9,7 +9,7 @@ import junit.framework.TestCase;
|
|||
import org.jasig.cas.authentication.principal.Principal;
|
||||
import org.jasig.cas.authentication.principal.SimplePrincipal;
|
||||
import org.jasig.cas.client.authorization.AuthorizationException;
|
||||
import org.jasig.cas.client.authorization.CasAuthorizedDecider;
|
||||
import org.jasig.cas.client.authorization.AuthorizedDecider;
|
||||
import org.jasig.cas.client.validation.AssertionImpl;
|
||||
import org.springframework.mock.web.MockFilterConfig;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
|
|
@ -23,18 +23,18 @@ import javax.servlet.ServletResponse;
|
|||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Tests for the CasAuthorizationFilter.
|
||||
* Tests for the AuthorizationFilter.
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasAuthorizationFilterTests extends TestCase {
|
||||
public final class AuthorizationFilterTests extends TestCase {
|
||||
|
||||
private CasAuthorizationFilter casAuthorizationFilter;
|
||||
private AuthorizationFilter casAuthorizationFilter;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.casAuthorizationFilter = new CasAuthorizationFilter(new CasAuthorizedDecider() {
|
||||
this.casAuthorizationFilter = new AuthorizationFilter(new AuthorizedDecider() {
|
||||
|
||||
public boolean isAuthorizedToUseApplication(Principal principal) {
|
||||
return principal.getId().equals("scott");
|
||||
|
|
@ -115,8 +115,7 @@ public final class HttpServletRequestWrapperFilterTests extends TestCase {
|
|||
.getUserPrincipal());
|
||||
assertEquals(request.isRequestedSessionIdFromCookie(), this.mockRequest
|
||||
.isRequestedSessionIdFromCookie());
|
||||
assertEquals(request.isRequestedSessionIdFromUrl(), this.mockRequest
|
||||
.isRequestedSessionIdFromUrl());
|
||||
|
||||
assertEquals(request.isRequestedSessionIdFromURL(), this.mockRequest
|
||||
.isRequestedSessionIdFromURL());
|
||||
assertEquals(request.isRequestedSessionIdValid(), this.mockRequest
|
||||
|
|
@ -146,10 +145,7 @@ public final class HttpServletRequestWrapperFilterTests extends TestCase {
|
|||
.getParameter("test"));
|
||||
assertEquals(request.getParameterValues("test"), this.mockRequest
|
||||
.getParameterValues("test"));
|
||||
assertEquals(request.getRealPath("test"), this.mockRequest
|
||||
.getRealPath("test"));
|
||||
assertEquals(request.getRequestDispatcher("test").getClass(),
|
||||
this.mockRequest.getRequestDispatcher("test").getClass());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ import javax.servlet.ServletResponse;
|
|||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Tests for the CasValidationFilter.
|
||||
* Tests for the TicketValidationFilter.
|
||||
*
|
||||
* @author Scott Battaglia
|
||||
* @version $Revision$ $Date$
|
||||
* @since 3.0
|
||||
*/
|
||||
public final class CasValidationFilterTests extends TestCase {
|
||||
public final class ValidationFilterTests extends TestCase {
|
||||
|
||||
private CasValidationFilter filter;
|
||||
private TicketValidationFilter filter;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
this.filter = new CasValidationFilter("localhost:8443", null, new TicketValidator() {
|
||||
this.filter = new TicketValidationFilter("localhost:8443", null, new TicketValidator() {
|
||||
|
||||
public Assertion validate(final String ticketId,
|
||||
final Service service) throws ValidationException {
|
||||
Loading…
Reference in New Issue