@Test
public void getManagerOfUserReturnsHierarchyUserWhenManagerIsNull() {

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