@Test
public void getStaffMemberDataOfUserReturnsDataAfterInitializationWhenPresent() {

    // given
    var sort = Sort.unsorted();
    var otherUserId = "other-user";
    var expectedId = 1337L;
    var expectedFirstName = "First";
    var expectedLastName = "Last";
    var expectedMail = "mail@test.de";
    var expectedLob = "LoB Test";
    var expectedThumbnail = new byte[] {2, 1, 32, 4, 7, 42};
    var expectedData = new UserData(otherUserMock, expectedFirstName, expectedLastName, expectedMail, expectedLob, expectedThumbnail)
            .setId(expectedId)
            .setPictureInitialized(true);
    var uninitializedData = new UserData(otherUserMock, expectedFirstName, expectedLastName, expectedMail, expectedLob)
            .setId(expectedId);
    given(otherUserMock.getId()).willReturn(otherUserId);
    given(hierarchyTreeNodeRepoMock.findByUser(userMock)).willReturn(Optional.of(hierarchyTreeNodeMock));
    given(hierarchyTreeNodeMock.getDirectStaff()).willReturn(List.of(otherHierarchyTreeNodeMock));
    given(otherHierarchyTreeNodeMock.getUser()).willReturn(otherUserMock);
    given(ldapAdapterMock.getThumbnailPhotos(List.of(otherUserId))).willReturn(Map.of(
            otherUserId, expectedThumbnail
    ));
    given(userDataRepoMock.findByUserIn(List.of(otherUserMock), sort)).willReturn(List.of(uninitializedData));
    given(userDataRepoMock.saveAll(List.of(expectedData))).willReturn(List.of(expectedData));
    // when
    var actualData = repoUserService.getStaffMemberUserDataOfUser(userMock, sort);
    // then
    assertThat(actualData).containsExactly(expectedData);
}