Skip to content

Commit

Permalink
adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 30, 2023
1 parent 0aaf1ba commit 189b687
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import static <%= otherEntity.entityAbsolutePackage %>.domain.<%= otherEntity.pe
import <%= otherEntity.entityAbsolutePackage %>.domain.<%= otherEntity.persistClass %>;
<%_ } _%>
<%_ if (relationships.some(relationship => relationship.collection)) { _%>
import java.util.HashSet;
import java.util.Set;
<%_ } _%>
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -92,7 +93,7 @@ class <%= persistClass %>Test {
<%_ } _%>
<%_ if (relationship.collection) { _%>

<%= persistInstance %>.set<%- relationship.propertyNameCapitalized %>(Set.of(<%= relationship.otherEntity.persistInstance %>Back));
<%= persistInstance %>.set<%- relationship.propertyNameCapitalized %>(new HashSet<>(Set.of(<%= relationship.otherEntity.persistInstance %>Back)));
assertThat(<%= persistInstance %>.get<%- relationship.propertyNameCapitalized %>()).containsOnly(<%= relationship.otherEntity.persistInstance %>Back);
<%_ if (relationship.otherRelationship && !relationship.ownerSide && !relationship.otherEntity.embedded) { _%>
<%_ if (relationship.otherRelationship.collection) { _%>
Expand All @@ -102,7 +103,7 @@ class <%= persistClass %>Test {
<%_ } _%>
<%_ } _%>

<%= persistInstance %>.set<%- relationship.propertyNameCapitalized %>(Set.of());
<%= persistInstance %>.set<%- relationship.propertyNameCapitalized %>(new HashSet<>());
assertThat(<%= persistInstance %>.get<%- relationship.propertyNameCapitalized %>()).doesNotContain(<%= relationship.otherEntity.persistInstance %>Back);
<%_ if (relationship.otherRelationship && !relationship.ownerSide && !relationship.otherEntity.embedded) { _%>
<%_ if (relationship.otherRelationship.collection) { _%>
Expand Down

0 comments on commit 189b687

Please sign in to comment.