Package org.springframework.security.authentication

Examples of org.springframework.security.authentication.TestingAuthenticationProvider.authenticate()


public class TestingAuthenticationProviderTests extends TestCase {

    public void testAuthenticates() {
        TestingAuthenticationProvider provider = new TestingAuthenticationProvider();
        TestingAuthenticationToken token = new TestingAuthenticationToken("Test", "Password","ROLE_ONE","ROLE_TWO");
        Authentication result = provider.authenticate(token);

        assertTrue(result instanceof TestingAuthenticationToken);

        TestingAuthenticationToken castResult = (TestingAuthenticationToken) result;
        assertEquals("Test", castResult.getPrincipal());
View Full Code Here

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.