Package waffle.shiro.negotiate

Source Code of waffle.shiro.negotiate.NegotiateAuthenticationStrategyTest

/**
* Waffle (https://github.com/dblock/waffle)
*
* Copyright (c) 2010 - 2014 Application Security, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*     Application Security, Inc.
*/
package waffle.shiro.negotiate;

import org.apache.shiro.realm.Realm;
import org.apache.shiro.realm.text.IniRealm;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
* @author Dan Rollo Date: 3/18/13 Time: 3:34 PM
*/
public class NegotiateAuthenticationStrategyTest {

    private NegotiateAuthenticationStrategy authStrategy;

    @Before
    public void setUp() {
        this.authStrategy = new NegotiateAuthenticationStrategy();
    }

    @Test(expected = AuthenticationInProgressException.class)
    public void testAfterAttempt() throws Exception {

        final Realm otherRealm = new IniRealm();

        this.authStrategy.afterAttempt(otherRealm, null, null, null, new RuntimeException());

        final AuthenticationInProgressException authInProgressException = new AuthenticationInProgressException();

        this.authStrategy.afterAttempt(otherRealm, null, null, null, authInProgressException);

        this.authStrategy.afterAttempt(new NegotiateAuthenticationRealm(), null, null, null, authInProgressException);
        Assert.fail();
    }
}
TOP

Related Classes of waffle.shiro.negotiate.NegotiateAuthenticationStrategyTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.