wrappedPop2.setGroupSearchFilter( "(uniqueMember={0})" ); //$NON-NLS-1$
Set populators = new HashSet();
populators.add( wrappedPop );
populators.add( wrappedPop2 );
UnionizingLdapAuthoritiesPopulator unionizer = new UnionizingLdapAuthoritiesPopulator();
unionizer.setPopulators( populators );
unionizer.afterPropertiesSet();
// get the user record
DirContextOperations ctx = new SpringSecurityLdapTemplate( getContextSource() ).retrieveEntry( "uid=suzy,ou=users", //$NON-NLS-1$
null );
GrantedAuthority[] auths = unionizer.getGrantedAuthorities( ctx, "suzy" ); //$NON-NLS-1$
assertTrue( null != auths && auths.length > 0 );
List authsList = Arrays.asList( auths );
assertTrue( authsList.contains( new GrantedAuthorityImpl( "ROLE_POWER_USER" ) ) ); //$NON-NLS-1$