Skip to content

Commit

Permalink
Pact Live: PricingServiceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
yacekmm committed Sep 3, 2024
1 parent 6249f71 commit 26db900
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.bottega.promoter.concert.api.app;

import java.util.List;

import com.bottega.promoter.concert.*;
import com.bottega.promoter.concert.Price;
import com.bottega.promoter.concert.domain.Concert;
import com.bottega.promoter.concert.fixtures.ConcertLogicTestBase;
import com.bottega.sharedlib.vo.Money;
import com.bottega.sharedlib.vo.error.ErrorResult;
import io.vavr.control.Either;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.List;

import static com.bottega.promoter.concert.fixtures.asserts.PriceAssert.assertThatPrice;
import static com.bottega.sharedlib.fixtures.ErrorAssert.assertThatError;
import static com.bottega.sharedlib.vo.error.ErrorType.NOT_FOUND;
Expand All @@ -28,12 +28,9 @@ void discountConcert_discountsConcert_onValidInput() {
Either<ErrorResult, List<Price>> result = concertFixtures.concertService.discountConcert(concert.getId().asString(), 10);

//then
assertThat(result).hasRightValueSatisfying(prices -> {
Assertions.assertThat(prices).hasSize(1);
assertThatPrice(prices.getFirst())
.equalTo(new Money(90_00))
.hasFactors(new PriceFactor("PERCENTAGE", 10, null));
});
assertThatPrice(result.get().getFirst())
.equalTo(new Money(90_00));

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import static com.bottega.promoter.concert.fixtures.asserts.PriceAssert.assertThatPrice;

class PricingServiceTest extends ConcertLogicTestBase {
class PricingService_liveCoding_Test extends ConcertLogicTestBase {

private PricingService pricingService;

Expand Down

0 comments on commit 26db900

Please sign in to comment.