Skip to content

Commit

Permalink
Update _persistClass_Test.java.ejs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Oct 29, 2023
1 parent 22dde5e commit e18e340
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import static <%= otherEntity.entityAbsolutePackage %>.domain.<%= otherEntity.pe
import <%= otherEntity.entityAbsolutePackage %>.domain.<%= otherEntity.persistClass %>;
<%_ } _%>
<%_ if (relationships.some(relationship => relationship.collection)) { _%>
import java.util.Collections;
import java.util.Set;
<%_ } _%>
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -92,7 +92,7 @@ class <%= persistClass %>Test {
<%_ } _%>
<%_ if (relationship.collection) { _%>

<%= persistInstance %>.set<%- relationship.propertyNameCapitalized %>(Collections.singleton(<%= relationship.otherEntity.persistInstance %>Back));
<%= persistInstance %>.set<%- relationship.propertyNameCapitalized %>(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 Down

0 comments on commit e18e340

Please sign in to comment.