From eb7564f0c5be16dc3090b3fb18bfe2a67f4c99f7 Mon Sep 17 00:00:00 2001 From: Jacek Milewski Date: Sat, 30 Dec 2023 15:16:36 +0100 Subject: [PATCH] task-repo-tests --- .../api/app/ConcertService_createConcert_compTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/services/Promoter/src/test/java/com/bottega/promoter/concert/api/app/ConcertService_createConcert_compTest.java b/services/Promoter/src/test/java/com/bottega/promoter/concert/api/app/ConcertService_createConcert_compTest.java index 92c099cd..59424880 100644 --- a/services/Promoter/src/test/java/com/bottega/promoter/concert/api/app/ConcertService_createConcert_compTest.java +++ b/services/Promoter/src/test/java/com/bottega/promoter/concert/api/app/ConcertService_createConcert_compTest.java @@ -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) @@ -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 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