test_class.declarator: SAMPLE_USERNAME = "username"
test_class.modifier: private static final
test_class.original_string: private static final String SAMPLE_USERNAME = "username";
test_class.type: String
test_class.var_name: SAMPLE_USERNAME
test_class.declarator: mapper
test_class.modifier: private
test_class.original_string: private CustomAttributesLdapUserDetailsMapper mapper;
test_class.type: CustomAttributesLdapUserDetailsMapper
test_class.var_name: mapper
test_class.declarator: attributeMappings
test_class.modifier: private
test_class.original_string: private Map<String, String> attributeMappings;
test_class.type: Map<String, String>
test_class.var_name: attributeMappings
test_class.declarator: authorities
test_class.modifier: private
test_class.original_string: private Collection<GrantedAuthority> authorities;
test_class.type: Collection<GrantedAuthority>
test_class.var_name: authorities
test_class.declarator: ctx
test_class.original_string: MockDirContextOperations ctx;
test_class.type: MockDirContextOperations
test_class.var_name: ctx
test_class.file: src/core/security/src/test/java/it/geosolutions/geostore/core/security/ldap/CustomAttributesLdapUserDetailsMapperTest.java
test_class.identifier: CustomAttributesLdapUserDetailsMapperTest
test_case.body: @Test
      public void testMappings() {
          ctx.getLdapAttributes().put("cn", "mock");
          attributeMappings.put("FullName", "cn");
          UserDetails details = mapper.mapUserFromContext(ctx, SAMPLE_USERNAME, authorities);
          assertTrue(details instanceof UserDetailsWithAttributes);
          UserDetailsWithAttributes detailsWithAttribute = (UserDetailsWithAttributes) details;
          assertEquals("mock", detailsWithAttribute.getAttribute("FullName"));
      }
test_case.class_method_signature: CustomAttributesLdapUserDetailsMapperTest.testMappings()
test_case.full_signature: @Test public void testMappings()
test_case.identifier: testMappings
test_case.invocations: put getLdapAttributes put mapUserFromContext assertTrue assertEquals getAttribute
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMappings()
focal_class.declarator: attributeMappings
focal_class.original_string: Map<String, String> attributeMappings;
focal_class.type: Map<String, String>
focal_class.var_name: attributeMappings
focal_class.file: src/core/security/src/main/java/it/geosolutions/geostore/core/security/ldap/CustomAttributesLdapUserDetailsMapper.java
focal_class.identifier: CustomAttributesLdapUserDetailsMapper
focal_class.class_method_signature: CustomAttributesLdapUserDetailsMapper.CustomAttributesLdapUserDetailsMapper(Map<String, String> attributeMappings)
focal_class.full_signature: public  CustomAttributesLdapUserDetailsMapper(Map<String, String> attributeMappings)
focal_class.identifier: CustomAttributesLdapUserDetailsMapper
focal_class.modifiers: public
focal_class.parameters: (Map<String, String> attributeMappings)
focal_class.signature:  CustomAttributesLdapUserDetailsMapper(Map<String, String> attributeMappings)
focal_class.class_method_signature: CustomAttributesLdapUserDetailsMapper.mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_class.full_signature: @Override public UserDetails mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_class.identifier: mapUserFromContext
focal_class.modifiers: @Override public
focal_class.parameters: (DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_class.return: UserDetails
focal_class.signature: UserDetails mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_class.superclass: extends LdapUserDetailsMapper
focal_method.body: @Override
      public UserDetails mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities) {
          LdapUserDetails details =  (LdapUserDetails)super.mapUserFromContext(ctx, username, authorities);
          LdapUserDetailsWithAttributes detailsWithAttributes = new LdapUserDetailsWithAttributes(details);
          for(String attributeName : attributeMappings.keySet()) {
              detailsWithAttributes.setAttribute(attributeName, ctx.getStringAttribute(attributeMappings.get(attributeName)));
          }
          return detailsWithAttributes;
      }
focal_method.class_method_signature: CustomAttributesLdapUserDetailsMapper.mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_method.full_signature: @Override public UserDetails mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_method.identifier: mapUserFromContext
focal_method.invocations: mapUserFromContext keySet setAttribute getStringAttribute get
focal_method.modifiers: @Override public
focal_method.parameters: (DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)
focal_method.return: UserDetails
focal_method.signature: UserDetails mapUserFromContext(DirContextOperations ctx, String username,
              Collection<GrantedAuthority> authorities)