Search in sources :

Example 11 with LdapConnection

use of com.gitblit.ldap.LdapConnection in project gitblit by gitblit.

the class LdapConnectionTest method testConnect.

@Test
public void testConnect() {
    // This test is independent from authentication mode, so run only once.
    assumeTrue(authMode == AuthMode.ANONYMOUS);
    LdapConnection conn = new LdapConnection(settings);
    try {
        assertTrue(conn.connect());
    } finally {
        conn.close();
    }
}
Also used : LdapConnection(com.gitblit.ldap.LdapConnection) Test(org.junit.Test)

Aggregations

LdapConnection (com.gitblit.ldap.LdapConnection)11 BindResult (com.unboundid.ldap.sdk.BindResult)9 Test (org.junit.Test)8 SearchResult (com.unboundid.ldap.sdk.SearchResult)6 SearchResultEntry (com.unboundid.ldap.sdk.SearchResultEntry)6 TeamModel (com.gitblit.models.TeamModel)2 UserModel (com.gitblit.models.UserModel)2 ArrayList (java.util.ArrayList)2 Attribute (com.unboundid.ldap.sdk.Attribute)1 SearchRequest (com.unboundid.ldap.sdk.SearchRequest)1 IOException (java.io.IOException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 HashMap (java.util.HashMap)1 Matcher (java.util.regex.Matcher)1