authenticate method should not log errors (LDAP-170)

This commit is contained in:
Ulrik Sandberg
2010-10-17 10:38:59 +00:00
parent ce9042ebcf
commit fb6b20de57
4 changed files with 19 additions and 8 deletions

View File

@@ -26,6 +26,7 @@ import javax.naming.directory.DirContext;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.ldap.core.AuthenticatedLdapEntryContextCallback;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapEntryIdentification;
@@ -101,13 +102,13 @@ public class LdapTemplateAuthenticationITest extends AbstractLdapTemplateIntegra
assertFalse(tested.authenticate("", filter.toString(), "password"));
}
@Test
@Test(expected=IncorrectResultSizeDataAccessException.class)
public void testAuthenticateWithFilterThatMatchesSeveralEntries() {
AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("objectclass", "person")).and(new WhitespaceWildcardsFilter("uid", "some.person"));
assertFalse(tested.authenticate("", filter.toString(), "password"));
filter.and(new EqualsFilter("objectclass", "person")).and(new EqualsFilter("cn", "Some Person"));
tested.authenticate("", filter.toString(), "password");
}
@Test
public void testLookupAttemptingCallback() {
AndFilter filter = new AndFilter();