test_class.declarator: ID_ATTR_ID = "sAMAccountName"
test_class.modifier: private final
test_class.original_string: private final String ID_ATTR_ID = "sAMAccountName";
test_class.type: String
test_class.var_name: ID_ATTR_ID
test_class.declarator: mapper
test_class.modifier: private
test_class.original_string: private LdapUserNodeMapper mapper;
test_class.type: LdapUserNodeMapper
test_class.var_name: mapper
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/ad/service/mapper/LdapUserNodeMapperTest.java
test_class.identifier: LdapUserNodeMapperTest
test_case.body: @Test
      public void mapFromAttributeReturnsExpectedNode() throws NamingException {
          // given
          var expectedId = "ID";
          var expectedName = "full name";
          var expectedGivenName = "given name";
          var expectedMail = "mail@test.com";
          var expectedManagerDn = "manager DN";
          var expectedSurname = "surname";
          var expectedDepartment = "department";
          var expectedDivision = "division";
          var expectedDn = "user DN";
          var expectedDirectReports = List.of("D1", "D2");
  
          var idAttr = createAttribute(ID_ATTR_ID, expectedId);
          var nameAttr = createAttribute("name", expectedName);
          var givenNameAttr = createAttribute("givenName", expectedGivenName);
          var mailAttr = createAttribute("mail", expectedMail);
          var managerAttr = createAttribute("manager", expectedManagerDn);
          var surnameAttr = createAttribute("sn", expectedSurname);
          var departmentAttr = createAttribute("department", expectedDepartment);
          var divisionAttr = createAttribute("division", expectedDivision);
          var dnAttr = createAttribute("distinguishedName", expectedDn);
          var directReportsAttr = createAttribute("directReports", "D1", "D2");
  
          var attributes = new BasicAttributes();
          for(var attr : List.of(idAttr, nameAttr, givenNameAttr, mailAttr, managerAttr,
                  surnameAttr, departmentAttr, divisionAttr, dnAttr, directReportsAttr)) {
              attributes.put(attr);
          }
  
          var expectedNode = new LdapUserNode(expectedId, expectedName, expectedGivenName, expectedSurname,
                  expectedMail, expectedDivision, expectedDepartment, expectedDn,
                  expectedManagerDn, expectedDirectReports);
  
          // when
          var actualNode = mapper.mapFromAttributes(attributes);
  
          // then
          assertThat(actualNode).isEqualTo(expectedNode);
      }
test_case.class_method_signature: LdapUserNodeMapperTest.mapFromAttributeReturnsExpectedNode()
test_case.full_signature: @Test public void mapFromAttributeReturnsExpectedNode()
test_case.identifier: mapFromAttributeReturnsExpectedNode
test_case.invocations: of createAttribute createAttribute createAttribute createAttribute createAttribute createAttribute createAttribute createAttribute createAttribute createAttribute of put mapFromAttributes isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void mapFromAttributeReturnsExpectedNode()
focal_class.declarator: idAttribute
focal_class.modifier: private final
focal_class.original_string: private final String idAttribute;
focal_class.type: String
focal_class.var_name: idAttribute
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/ad/service/mapper/LdapUserNodeMapper.java
focal_class.identifier: LdapUserNodeMapper
focal_class.class_method_signature: LdapUserNodeMapper.LdapUserNodeMapper(String idAttribute)
focal_class.full_signature: public  LdapUserNodeMapper(String idAttribute)
focal_class.identifier: LdapUserNodeMapper
focal_class.modifiers: public
focal_class.parameters: (String idAttribute)
focal_class.signature:  LdapUserNodeMapper(String idAttribute)
focal_class.class_method_signature: LdapUserNodeMapper.mapFromAttributes(Attributes attributes)
focal_class.full_signature: @Override public LdapUserNode mapFromAttributes(Attributes attributes)
focal_class.identifier: mapFromAttributes
focal_class.modifiers: @Override public
focal_class.parameters: (Attributes attributes)
focal_class.return: LdapUserNode
focal_class.signature: LdapUserNode mapFromAttributes(Attributes attributes)
focal_class.superclass: extends BaseAttributeMapper<LdapUserNode>
focal_method.body: @Override
      public LdapUserNode mapFromAttributes(Attributes attributes) throws NamingException {
          var idAttrValue = getSingleAttributeValue(attributes, idAttribute, String.class);
          var nameAttrValue = getSingleAttributeValue(attributes, "name", String.class);
          var givenNameAttrValue = getSingleAttributeValue(attributes, "givenName", String.class);
          var mailAttrValue = getSingleAttributeValue(attributes, "mail", String.class);
          var managerAttrValue = getSingleAttributeValue(attributes, "manager", String.class);
          var snAttrValue = getSingleAttributeValue(attributes, "sn", String.class);
          var departmentAttrValue = getSingleAttributeValue(attributes, "department", String.class);
          var divisionAttrValue = getSingleAttributeValue(attributes, "division", String.class);
          var dnAttrValue = getSingleAttributeValue(attributes, "distinguishedName", String.class);
  
          var directReportsAttrValue = getAllAttributeValues(attributes, "directReports", String.class);
  
          return new LdapUserNode(idAttrValue, nameAttrValue, givenNameAttrValue, snAttrValue,
                  mailAttrValue, divisionAttrValue, departmentAttrValue, dnAttrValue, managerAttrValue, directReportsAttrValue);
      }
focal_method.class_method_signature: LdapUserNodeMapper.mapFromAttributes(Attributes attributes)
focal_method.full_signature: @Override public LdapUserNode mapFromAttributes(Attributes attributes)
focal_method.identifier: mapFromAttributes
focal_method.invocations: getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getSingleAttributeValue getAllAttributeValues
focal_method.modifiers: @Override public
focal_method.parameters: (Attributes attributes)
focal_method.return: LdapUserNode
focal_method.signature: LdapUserNode mapFromAttributes(Attributes attributes)