@Test
public void getStaffMemberDataOfUserThrowsExceptionWhenDataIsNotPresent() {

    // given
    var sort = Sort.unsorted();
    var expectedMessage = "Data for some staff members is not present!";
    given(hierarchyTreeNodeRepoMock.findByUser(userMock)).willReturn(Optional.of(hierarchyTreeNodeMock));
    given(hierarchyTreeNodeMock.getDirectStaff()).willReturn(List.of(otherHierarchyTreeNodeMock));
    given(otherHierarchyTreeNodeMock.getUser()).willReturn(otherUserMock);
    given(userDataRepoMock.findByUserIn(List.of(otherUserMock), sort)).willReturn(List.of());
    // when / then
    assertThatThrownBy(() -> repoUserService.getStaffMemberUserDataOfUser(userMock, sort))
            .isInstanceOf(IllegalStateException.class)
            .hasMessage(expectedMessage);
}