diff --git a/src/core/security/src/test/java/it/geosolutions/geostore/core/security/SimpleGrantedAuthoritiesMapperTest.java b/src/core/security/src/test/java/it/geosolutions/geostore/core/security/SimpleGrantedAuthoritiesMapperTest.java index 40ecc32f..5dbd19e9 100644 --- a/src/core/security/src/test/java/it/geosolutions/geostore/core/security/SimpleGrantedAuthoritiesMapperTest.java +++ b/src/core/security/src/test/java/it/geosolutions/geostore/core/security/SimpleGrantedAuthoritiesMapperTest.java @@ -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 mapped = mapper.mapAuthorities(authorities); + assertEquals(1, mapped.size()); + assertEquals("B", mapped.iterator().next().getAuthority()); + } + }