test_class.declarator: mapper
test_class.original_string: SimpleGrantedAuthoritiesMapper mapper;
test_class.type: SimpleGrantedAuthoritiesMapper
test_class.var_name: mapper
test_class.declarator: roleMappings
test_class.modifier: private
test_class.original_string: private Map<String, String> roleMappings;
test_class.type: Map<String, String>
test_class.var_name: roleMappings
test_class.declarator: authorities
test_class.original_string: List<GrantedAuthority> authorities;
test_class.type: List<GrantedAuthority>
test_class.var_name: authorities
test_class.file: src/core/security/src/test/java/it/geosolutions/geostore/core/security/SimpleGrantedAuthoritiesMapperTest.java
test_class.identifier: SimpleGrantedAuthoritiesMapperTest
test_case.body: @Test
     public void testMapping() {
         roleMappings.put("A", "B");
         authorities.add(new GrantedAuthorityImpl("A"));
         Collection<? extends GrantedAuthority> mapped = mapper.mapAuthorities(authorities);
         assertEquals(1, mapped.size());
         assertEquals("B", mapped.iterator().next().getAuthority());
     }
test_case.class_method_signature: SimpleGrantedAuthoritiesMapperTest.testMapping()
test_case.full_signature: @Test public void testMapping()
test_case.identifier: testMapping
test_case.invocations: put add mapAuthorities assertEquals size assertEquals getAuthority next iterator
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMapping()
focal_class.declarator: mappings = new HashMap<String, String>()
focal_class.modifier: private
focal_class.original_string: private Map<String, String> mappings = new HashMap<String, String>();
focal_class.type: Map<String, String>
focal_class.var_name: mappings
focal_class.file: src/core/security/src/main/java/it/geosolutions/geostore/core/security/SimpleGrantedAuthoritiesMapper.java
focal_class.identifier: SimpleGrantedAuthoritiesMapper
focal_class.interfaces: implements GrantedAuthoritiesMapper
focal_class.class_method_signature: SimpleGrantedAuthoritiesMapper.SimpleGrantedAuthoritiesMapper(Map<String, String> mappings)
focal_class.full_signature: public  SimpleGrantedAuthoritiesMapper(Map<String, String> mappings)
focal_class.identifier: SimpleGrantedAuthoritiesMapper
focal_class.modifiers: public
focal_class.parameters: (Map<String, String> mappings)
focal_class.signature:  SimpleGrantedAuthoritiesMapper(Map<String, String> mappings)
focal_class.class_method_signature: SimpleGrantedAuthoritiesMapper.mapAuthorities(
              Collection<? extends GrantedAuthority> authorities)
focal_class.full_signature: @Override public Collection<? extends GrantedAuthority> mapAuthorities(
              Collection<? extends GrantedAuthority> authorities)
focal_class.identifier: mapAuthorities
focal_class.modifiers: @Override public
focal_class.parameters: (
              Collection<? extends GrantedAuthority> authorities)
focal_class.return: Collection<? extends GrantedAuthority>
focal_class.signature: Collection<? extends GrantedAuthority> mapAuthorities(
              Collection<? extends GrantedAuthority> authorities)
focal_method.body: @Override
      public Collection<? extends GrantedAuthority> mapAuthorities(
              Collection<? extends GrantedAuthority> authorities) {
          if(mappings.isEmpty()) {
              return authorities;
          }
          List<GrantedAuthority> result = new ArrayList<GrantedAuthority>();
          for(GrantedAuthority authority : authorities) {
              if(mappings.containsKey(authority.getAuthority())) {
                  result.add(new GrantedAuthorityImpl(mappings.get(authority.getAuthority())));
              } else {
                  result.add(authority);
              }
          }
          return result;
      }
focal_method.class_method_signature: SimpleGrantedAuthoritiesMapper.mapAuthorities(
              Collection<? extends GrantedAuthority> authorities)
focal_method.full_signature: @Override public Collection<? extends GrantedAuthority> mapAuthorities(
              Collection<? extends GrantedAuthority> authorities)
focal_method.identifier: mapAuthorities
focal_method.invocations: isEmpty containsKey getAuthority add get getAuthority add
focal_method.modifiers: @Override public
focal_method.parameters: (
              Collection<? extends GrantedAuthority> authorities)
focal_method.return: Collection<? extends GrantedAuthority>
focal_method.signature: Collection<? extends GrantedAuthority> mapAuthorities(
              Collection<? extends GrantedAuthority> authorities)