Package org.springframework.ldap

Examples of org.springframework.ldap.CommunicationException


    @Test
    public void authenticateWithNamingException() {
        UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken("ben", "benspassword");
        LdapAuthenticator mockAuthenticator = mock(LdapAuthenticator.class);
        CommunicationException expectedCause = new CommunicationException(new javax.naming.CommunicationException());
        when(mockAuthenticator.authenticate(authRequest)).thenThrow(expectedCause);

        LdapAuthenticationProvider ldapProvider = new LdapAuthenticationProvider(mockAuthenticator);
        try {
            ldapProvider.authenticate(authRequest);
View Full Code Here

TOP

Related Classes of org.springframework.ldap.CommunicationException

Copyright © 2018 www.massapicom. 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.