SEC-950: Added test to attempt to reproduce problem.

This commit is contained in:
Luke Taylor 2008-08-08 15:41:14 +00:00
parent 8b376ccdeb
commit 3a9eb018ba
1 changed files with 11 additions and 0 deletions

View File

@ -56,6 +56,17 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapIntegrationTests
assertEquals(new DistinguishedName("uid=bob,ou=people"), bob.getDn());
}
@Test
public void searchForNameWithCommaSucceeds() {
FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", dirCtxFactory);
locator.setSearchSubtree(false);
DirContextOperations jerry = locator.searchForUser("jerry");
assertEquals("jerry", jerry.getStringAttribute("uid"));
assertEquals(new DistinguishedName("cn=mouse\\, jerry,ou=people"), jerry.getDn());
}
// Try some funny business with filters.
@Test
public void extraFilterPartToExcludeBob() throws Exception {