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:
@@ -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_");
|
||||
|
||||
Reference in New Issue
Block a user