SEC-1641: Remove the private setGroupSearchBase method and allowed a null value to be set for the group search base in the constructor.

This commit is contained in:
Luke Taylor
2010-12-19 16:18:30 +00:00
parent f1fe3ce7e6
commit 3547cfcc92
2 changed files with 29 additions and 22 deletions

View File

@@ -56,6 +56,17 @@ public class DefaultLdapAuthoritiesPopulatorTests extends AbstractLdapIntegratio
assertTrue(AuthorityUtils.authorityListToSet(authorities).contains("ROLE_USER"));
}
@Test
public void nullSearchBaseIsAccepted() throws Exception {
populator = new DefaultLdapAuthoritiesPopulator(getContextSource(), "ou=groups");
populator.setDefaultRole("ROLE_USER");
Collection<GrantedAuthority> authorities = populator.getGrantedAuthorities(
new DirContextAdapter(new DistinguishedName("cn=notfound")), "notfound");
assertEquals(1, authorities.size());
assertTrue(AuthorityUtils.authorityListToSet(authorities).contains("ROLE_USER"));
}
@Test
public void groupSearchReturnsExpectedRoles() {
populator.setRolePrefix("ROLE_");