LdapAuthenticationProviderTest.java 1.12 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
package pwc.taxtech.atms.security;

import java.util.Hashtable;

import org.junit.Assert;
import org.junit.Test;

public class LdapAuthenticationProviderTest {

    // 暂时跳过该测试方法
    // @Test
    public void authenticateOk() {
        LdapAuthenticationProvider ldapAuthenticationProvider = new LdapAuthenticationProviderImpl();
        String username = "xxx";
        String password = "xxx";
        String ldapUrl = "LDAP://nam.ad.pwcinternal.com";
        String domain = "NAM";
        boolean result = ldapAuthenticationProvider.authenticate(username, password, ldapUrl, domain);
        System.out.println(result);
        // Assert.assertTrue(result);
    }

    @Test
    public void newClass() {
        LdapAuthenticationProviderImpl ldapAuthenticationProvider = new LdapAuthenticationProviderImpl();
        String username = "xxx";
        String password = "xxx";
        String ldapUrl = "LDAP://nam.ad.pwcinternal.com";
        String domain = "NAM";
        Hashtable<String, String> param = ldapAuthenticationProvider.buildParam(username, password, ldapUrl, domain);
        Assert.assertNotNull(param);
    }
}