use of org.springframework.ldap.core.support.AbstractContextSource in project gocd by gocd.
the class LdapContextSourceConfiguratorTest method shouldSet_ManagerDnAndPassword_OnContextSource.
@Test
public void shouldSet_ManagerDnAndPassword_OnContextSource() {
LdapContextSourceConfigurator configurator = new LdapContextSourceConfigurator(new LdapConfig("uri", "managerDn", "managerPass", null, true, new BasesConfig(new BaseConfig("searchBase")), "searchFilter"));
AbstractContextSource ctxSrc = mock(AbstractContextSource.class);
configurator.configure(ctxSrc);
verify(ctxSrc).setPassword("managerPass");
verify(ctxSrc).setUserDn("managerDn");
}
use of org.springframework.ldap.core.support.AbstractContextSource in project gocd by gocd.
the class LdapContextSourceConfiguratorTest method shouldNotSet_EitherManagerDn_OrPassword_OnContextSource_WhenNoManagerDnConfigured.
@Test
public void shouldNotSet_EitherManagerDn_OrPassword_OnContextSource_WhenNoManagerDnConfigured() {
GoCipher goCipher = new GoCipher();
LdapContextSourceConfigurator configurator = new LdapContextSourceConfigurator(new LdapConfig(goCipher));
AbstractContextSource ctxSrc = mock(AbstractContextSource.class);
configurator.configure(ctxSrc);
verify(ctxSrc, never()).setPassword(any(String.class));
verify(ctxSrc, never()).setUserDn(any(String.class));
}
Aggregations