@Test
public void buildHierarchyNodesThrowsExceptionWhenNodesMissing() {

    // given
    var rootUserId = "root-user";
    var rootNodeDn = "root-dn";
    var missingNodeDn = "mssing-node-dn";
    var rootNode = new LdapUserNode()
            .setId(rootUserId)
            .setDn(rootNodeDn)
            .setManagerDn(rootNodeDn)
            .setDirectReportsDn(List.of(missingNodeDn));
    var expectedMessage = String.format("Child node with DN '%s' not found!", missingNodeDn);
    // when / then
    assertThatThrownBy(() -> userUpdater.buildHierarchyTrees(List.of(rootNode), List.of(rootNode)))
            .isInstanceOf(IllegalArgumentException.class)
            .hasMessage(expectedMessage);
}