Commit 3b2cb428 authored by Misagh Moayyed's avatar Misagh Moayyed
Browse files

removed deprecated concepts

parent 82596206
......@@ -66,7 +66,7 @@ public class PolicyBasedAuthenticationManagerTests {
newMockHandler(false),
newMockHandler(false));
manager.authenticate(mock(Credential.class), mock(Credential.class));
fail("Should have thrown AuthenticationException");
fail("Should have thrown authentication exception");
}
@Test
......@@ -88,7 +88,7 @@ public class PolicyBasedAuthenticationManagerTests {
newMockHandler(false));
manager.setAuthenticationPolicy(new AllAuthenticationPolicy());
manager.authenticate(mock(Credential.class), mock(Credential.class));
fail("Should have thrown AuthenticationException");
fail("Should have thrown authentication exception");
}
@Test
......@@ -110,7 +110,7 @@ public class PolicyBasedAuthenticationManagerTests {
newMockHandler("HandlerB", false));
manager.setAuthenticationPolicy(new RequiredHandlerAuthenticationPolicy("HandlerB"));
manager.authenticate(mock(Credential.class), mock(Credential.class));
fail("Should have thrown AuthenticationException");
fail("Should have thrown AbstractAuthenticationException");
}
@Test
......
......@@ -67,7 +67,7 @@ public class RemoteCentralAuthenticationServiceTests extends AbstractCentralAuth
try {
this.remoteCentralAuthenticationService.createTicketGrantingTicket(
TestUtils.getCredentialsWithDifferentUsernameAndPassword());
fail("AuthenticationException expected.");
fail("Authentication exception expected.");
} catch (final AuthenticationException e) {
return;
}
......
......@@ -20,7 +20,7 @@ package org.jasig.cas.support.openid.web.mvc;
import org.apache.commons.lang3.StringUtils;
import org.jasig.cas.support.openid.OpenIdProtocolConstants;
import org.jasig.cas.web.DelegateController;
import org.jasig.cas.web.AbstractDelegateController;
import org.openid4java.message.Message;
import org.openid4java.message.ParameterList;
import org.openid4java.server.ServerManager;
......@@ -44,7 +44,7 @@ import java.util.Map;
* @since 3.5
*/
@Component("smartOpenIdAssociationController")
public class SmartOpenIdController extends DelegateController implements Serializable {
public class SmartOpenIdController extends AbstractDelegateController implements Serializable {
private static final long serialVersionUID = -594058549445950430L;
......
......@@ -19,7 +19,7 @@
package org.jasig.cas.support.spnego;
import org.jasig.cas.support.spnego.authentication.handler.support.JCSIFSpnegoAuthenticationHandlerTests;
import org.jasig.cas.support.spnego.authentication.handler.support.JcifsSpnegoAuthenticationHandlerTests;
import org.jasig.cas.support.spnego.authentication.principal.SpnegoCredentialsTests;
import org.jasig.cas.support.spnego.authentication.principal.SpnegoCredentialsToPrincipalResolverTests;
import org.jasig.cas.support.spnego.web.flow.client.AllSpnegoKnownClientSystemsFilterActionTest;
......@@ -34,7 +34,7 @@ import org.junit.runners.Suite;
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
JCSIFSpnegoAuthenticationHandlerTests.class,
JcifsSpnegoAuthenticationHandlerTests.class,
SpnegoCredentialsTests.class,
SpnegoCredentialsToPrincipalResolverTests.class,
AllSpnegoKnownClientSystemsFilterActionTest.class,
......
......@@ -21,7 +21,7 @@ package org.jasig.cas.support.spnego.authentication.handler.support;
import org.jasig.cas.authentication.UsernamePasswordCredential;
import org.jasig.cas.authentication.principal.DefaultPrincipalFactory;
import org.jasig.cas.authentication.principal.PrincipalFactory;
import org.jasig.cas.support.spnego.MockJCSIFAuthentication;
import org.jasig.cas.support.spnego.MockJcifsAuthentication;
import org.jasig.cas.support.spnego.authentication.principal.SpnegoCredential;
import org.junit.Before;
import org.junit.Test;
......@@ -33,23 +33,21 @@ import static org.junit.Assert.*;
/**
* @author Marc-Antoine Garrigue
* @author Arnaud Lesueur
* @since 3.1
* @deprecated As of 4.1, the class name is abbreviated in a way that is not per camel-casing standards and will be renamed in the future.
* @since 4.2.0
*/
@Deprecated
public class JCSIFSpnegoAuthenticationHandlerTests {
private JCIFSSpnegoAuthenticationHandler authenticationHandler;
public class JcifsSpnegoAuthenticationHandlerTests {
private JcifsSpnegoAuthenticationHandler authenticationHandler;
@Before
public void setUp() throws Exception {
this.authenticationHandler = new JCIFSSpnegoAuthenticationHandler();
this.authenticationHandler = new JcifsSpnegoAuthenticationHandler();
}
@Test
public void verifySuccessfulAuthenticationWithDomainName() throws Exception {
final SpnegoCredential credentials = new SpnegoCredential(new byte[] {0, 1, 2});
this.authenticationHandler.setPrincipalWithDomainName(true);
this.authenticationHandler.setAuthentication(new MockJCSIFAuthentication(true));
this.authenticationHandler.setAuthentication(new MockJcifsAuthentication(true));
assertNotNull(this.authenticationHandler.authenticate(credentials));
assertEquals("test", credentials.getPrincipal().getId());
assertNotNull(credentials.getNextToken());
......@@ -59,7 +57,7 @@ public class JCSIFSpnegoAuthenticationHandlerTests {
public void verifySuccessfulAuthenticationWithoutDomainName() throws Exception {
final SpnegoCredential credentials = new SpnegoCredential(new byte[] {0, 1, 2});
this.authenticationHandler.setPrincipalWithDomainName(false);
this.authenticationHandler.setAuthentication(new MockJCSIFAuthentication(true));
this.authenticationHandler.setAuthentication(new MockJcifsAuthentication(true));
assertNotNull(this.authenticationHandler.authenticate(credentials));
assertEquals("test", credentials.getPrincipal().getId());
assertNotNull(credentials.getNextToken());
......@@ -68,10 +66,10 @@ public class JCSIFSpnegoAuthenticationHandlerTests {
@Test
public void verifyUnsuccessfulAuthentication() throws Exception {
final SpnegoCredential credentials = new SpnegoCredential(new byte[] {0, 1, 2});
this.authenticationHandler.setAuthentication(new MockJCSIFAuthentication(false));
this.authenticationHandler.setAuthentication(new MockJcifsAuthentication(false));
try {
this.authenticationHandler.authenticate(credentials);
fail("An AuthenticationException should have been thrown");
fail("An AbstractAuthenticationException should have been thrown");
} catch (final GeneralSecurityException e) {
assertNull(credentials.getNextToken());
assertNull(credentials.getPrincipal());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment