Skip to content

Commit

Permalink
task-repo-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yacekmm committed Apr 21, 2024
1 parent 98f46a4 commit eb7564f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void createConcert_OK() {
VavrAssertions.assertThat(result).isRight();

assertThatConcert(concertFixtures.concertRepo.findAll().iterator().next())
.isPersistedIn(concertFixtures.concertRepo, RepoEntries.SINGULAR)
.hasTitle(request.title)
.hasIdAsUUID()
.hasDate(TEST_TIME_PLUS_30_DAYS)
Expand All @@ -43,12 +44,16 @@ void createConcert_OK() {
@Test
void createConcert_persistsConcert_onValidInput() {
//given
//TODO test that concert is persisted in repo
PromoterAgreement promoterAgreement = builders.aPromoterAgreement().build();
given(concertFixtures.promoterService.getPromoterAgreement(anyString())).willReturn(promoterAgreement);

//when
Either<ErrorResult, Concert> result = concertFixtures.concertService.createConcert("Woodstock 2000", TEST_TIME_PLUS_30_DAYS.toString(), promoterAgreement.promoterId().asString());

//then

assertThat(result).isRight();
assertThatConcert(result.get())
.isPersistedIn(concertFixtures.concertRepo, RepoEntries.SINGULAR);
}

@Test
Expand Down

0 comments on commit eb7564f

Please sign in to comment.