Skip to content

Commit

Permalink
fix: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge committed Jan 9, 2025
1 parent 01b2f41 commit 4901058
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,14 @@ public Integer getHierarchyLevel() {
return hierarchyLevel;
}

/**
* Note that the {@code path} is mapped with the "property access" mode. This method is for unit
* testing purposes only.
*/
public void updatePath() {
setPath(getPath());
}

/** Do not set directly. */
public void setHierarchyLevel(Integer hierarchyLevel) {
this.hierarchyLevel = hierarchyLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ public static OrganisationUnit createOrganisationUnit(char uniqueCharacter) {
unit.setCode("OrganisationUnitCode" + uniqueCharacter);
unit.setOpeningDate(date);
unit.setComment("Comment" + uniqueCharacter);
unit.updatePath();
return unit;
}

Expand All @@ -1021,7 +1022,7 @@ public static OrganisationUnit createOrganisationUnit(
OrganisationUnit unit = createOrganisationUnit(uniqueCharacter);
unit.setParent(parent);
parent.getChildren().add(unit);

unit.updatePath();
return unit;
}

Expand Down Expand Up @@ -1050,6 +1051,7 @@ public static OrganisationUnit createOrganisationUnit(String name, OrganisationU
OrganisationUnit unit = createOrganisationUnit(name);
unit.setParent(parent);
parent.getChildren().add(unit);
unit.updatePath();
return unit;
}

Expand Down

0 comments on commit 4901058

Please sign in to comment.