Skip to content

Commit

Permalink
Issue geosolutions-it#265 - included test dropUnmappedRoles
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Cristofori committed Apr 14, 2022
1 parent 638a066 commit caabf33
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ public void testMapping() {
assertEquals("B", mapped.iterator().next().getAuthority());
}

@Test
public void testDropUnmappedAuthiorities() {
mapper.setDropUnmapped(true);
roleMappings.put("A", "B");
authorities.add(new GrantedAuthorityImpl("A"));
authorities.add(new GrantedAuthorityImpl("C"));
Collection<? extends GrantedAuthority> mapped = mapper.mapAuthorities(authorities);
assertEquals(1, mapped.size());
assertEquals("B", mapped.iterator().next().getAuthority());
}

}

0 comments on commit caabf33

Please sign in to comment.