@Test
public void getHierarchyForUserReturnsHierarchyWhenPresent() {

    // given
    given(hierarchyTreeNodeRepoMock.findByUser(userMock)).willReturn(Optional.of(hierarchyTreeNodeMock));
    // when
    var actualHierarchy = repoUserService.getHierarchyForUser(userMock);
    // then
    assertThat(actualHierarchy).isEqualTo(hierarchyTreeNodeMock);
}