public void testDefaultRolesExtractor() throws Exception
{
Set<MembershipEntry> memberships = new HashSet<MembershipEntry>();
memberships.add(new MembershipEntry("exogroup"));
memberships.add(new MembershipEntry("exogroup/exogroup1/exogroup2", "member"));
DefaultRolesExtractorImpl extractor = new DefaultRolesExtractorImpl();
extractor.setUserRoleParentGroup("exogroup");
Set<String> roles = extractor.extractRoles("exo", memberships);
assertEquals(2, roles.size());
assertTrue(roles.contains("exogroup"));
assertTrue(roles.contains("exogroup2"));
Identity session = new Identity("exo", memberships, roles);
Collection<String> roles2 = session.getRoles();