@Test
public void getManagerOfUserReturnsManagerWhenHierarchyPresent() {

    // given
    given(hierarchyTreeNodeRepoMock.findByUser(userMock)).willReturn(Optional.of(hierarchyTreeNodeMock));
    given(hierarchyTreeNodeMock.getManager()).willReturn(otherHierarchyTreeNodeMock);
    given(otherHierarchyTreeNodeMock.getUser()).willReturn(otherUserMock);
    // when
    var actualManager = repoUserService.getManagerOfUser(userMock);
    // then
    assertThat(actualManager).isEqualTo(otherUserMock);
}