Skip to content

Commit

Permalink
Update _persistClass_IntegrationTestSamplesBuilder.java.ejs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Feb 5, 2024
1 parent 45ac4af commit ee00810
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package <%= entityAbsolutePackage %>.domain;

import <%= entityAbsolutePackage %>.repository.<%= persistClass %>Repository;
import <%= entityAbsolutePackage %>.repository.<%= entityClass %>Repository;
<%_ if (entityAbsolutePackage !== packageName) { _%>
import <%= packageName %>.domain.IntegrationTestSample;
<%_ } _%>
Expand All @@ -26,15 +26,15 @@ public class <%= persistClass %>IntegrationTestSamplesBuilder {
<%_ } _%>

Supplier<<%= persistClass %>> insertCallback = () -> {
<%= persistClass %>Repository <%= persistInstance %>Repository = applicationContext.getBean(<%= persistClass %>Repository.class);
<%= persistClass %> persisted = <%= persistInstance %>Repository.save(<%= persistClass %>TestSamples.build<%= persistClass %>InsertableSample1());
<%= entityClass %>Repository <%= entityInstance %>Repository = applicationContext.getBean(<%= entityClass %>Repository.class);
<%= persistClass %> persisted = <%= entityInstance %>Repository.save(<%= persistClass %>TestSamples.build<%= persistClass %>InsertableSample1());

return <%= persistClass %>TestSamples.clone(persisted);
};

Consumer<<%= persistClass %>> tearDownCallback = (<%= persistClass %> inserted) -> {
<%= persistClass %>Repository <%= persistInstance %>Repository = applicationContext.getBean(<%= persistClass %>Repository.class);
<%= persistInstance %>Repository.delete(inserted);
<%= entityClass %>Repository <%= entityInstance %>Repository = applicationContext.getBean(<%= entityClass %>Repository.class);
<%= entityInstance %>Repository.delete(inserted);

tearDownCallbacks.forEach((IntegrationTestSample<?> integrationTestSample) -> {
integrationTestSample.tearDown();
Expand Down

0 comments on commit ee00810

Please sign in to comment.