Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
cgendreau committed Oct 18, 2024
1 parent a1bc22f commit 23ceba6
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import io.crnk.core.queryspec.IncludeRelationSpec;
import io.crnk.core.queryspec.PathSpec;
import io.crnk.core.queryspec.QuerySpec;
import java.util.List;
import javax.inject.Inject;

public class SeqSubmissionRepositoryIT extends BaseRepositoryTest {
Expand Down Expand Up @@ -54,13 +57,19 @@ public void updateSeqReaction_onSuccess_SeqReactionUpdated() {
new QuerySpec(SeqSubmissionDto.class)
);

SeqBatchDto seqBatch = SeqBatchTestFixture.newSeqBatch();
seqBatchRepository.create(seqBatch);
SeqBatchDto seqBatch = seqBatchRepository.create(SeqBatchTestFixture.newSeqBatch());

found.setName("Updated name");
found.setSeqBatch(seqBatch);

SeqSubmissionDto updated = seqSubmissionRepositoryRepository.save(found);
seqSubmissionRepositoryRepository.save(found);

QuerySpec querySpec = new QuerySpec(SeqSubmissionDto.class);
querySpec.setIncludedRelations(List.of(new IncludeRelationSpec(PathSpec.of("seqBatch"))));

SeqSubmissionDto updated = seqSubmissionRepositoryRepository.findOne(
seqSubmissionDto.getUuid(), querySpec);

assertEquals("Updated name", updated.getName());
assertEquals(seqBatch.getUuid(), updated.getSeqBatch().getUuid());
}
Expand Down

0 comments on commit 23ceba6

Please sign in to comment.