Skip to content

Commit

Permalink
Fix test compilation failure when using serviceClass or serviceImpl (#…
Browse files Browse the repository at this point in the history
…201)

Fixes #197
  • Loading branch information
murdos authored Oct 26, 2020
1 parent 047fcc5 commit db8a9ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,11 @@ public class <%= entityClass %>ResourceIT <% if (databaseType === 'cassandra') {
<%_ if (databaseType === 'cassandra') { _%>
<%= asEntity(entityInstance) %>.setId(UUID.randomUUID());
<%_ } _%>
<%_ if (service !== 'no' && dto !== 'mapstruct') { _%>
<%= entityInstance %>Service.save(<%= asEntity(entityInstance) %>);
<%_ if (searchEngine === 'elasticsearch') { _%>
// As the test used the service layer, reset the Elasticsearch mock repository
reset(mock<%= entityClass %>SearchRepository);
<%_ } _%>
<%_ } else { _%>
<%= entityInstance %>Repository.save<% if (databaseType === 'sql') { %>AndFlush<% } %>(<%= asEntity(entityInstance) %>);
<%_ } _%>

int databaseSizeBeforeUpdate = <%= entityInstance %>Repository.findAll().size();

Expand Down Expand Up @@ -595,11 +591,7 @@ public class <%= entityClass %>ResourceIT <% if (databaseType === 'cassandra') {
<%_ if (databaseType === 'cassandra') { _%>
<%= asEntity(entityInstance) %>.setId(UUID.randomUUID());
<%_ } _%>
<%_ if (service !== 'no' && dto !== 'mapstruct') { _%>
<%= entityInstance %>Service.save(<%= asEntity(entityInstance) %>);
<%_ } else { _%>
<%= entityInstance %>Repository.save<% if (databaseType === 'sql') { %>AndFlush<% } %>(<%= asEntity(entityInstance) %>);
<%_ } _%>

int databaseSizeBeforeDelete = <%= entityInstance %>Repository.findAll().size();

Expand Down
2 changes: 2 additions & 0 deletions test-integration/samples/gradle-jwt-react.jdl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ application {
entities BankAccount, Label, Operation
}

@service(serviceClass)
entity BankAccount {
name String required,
balance BigDecimal required
}
entity Label {
label String required minlength(3)
}
@service(serviceImpl)
entity Operation {
date Instant required,
description String,
Expand Down

0 comments on commit db8a9ad

Please sign in to comment.