diff --git a/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/MemberAdapterTest.kt b/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/MemberAdapterTest.kt index f33b016..dc2d48e 100644 --- a/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/MemberAdapterTest.kt +++ b/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/MemberAdapterTest.kt @@ -9,6 +9,7 @@ import com.example.estdelivery.coupon.application.port.out.adapter.persistence.r import com.example.estdelivery.coupon.domain.coupon.Coupon import com.example.estdelivery.coupon.domain.coupon.CouponType import io.kotest.matchers.shouldBe +import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest @@ -28,6 +29,7 @@ class MemberAdapterTest( @Autowired private val couponRepository: CouponRepository, ) { + @BeforeEach fun setUp() { memberCouponRepository.deleteAll() couponRepository.deleteAll() diff --git a/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/persistence/MemberPersistenceAdapterTest.kt b/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/persistence/MemberPersistenceAdapterTest.kt index b2f1d02..bc8b4d0 100644 --- a/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/persistence/MemberPersistenceAdapterTest.kt +++ b/coupon/src/test/kotlin/com/example/estdelivery/coupon/application/port/out/adapter/persistence/MemberPersistenceAdapterTest.kt @@ -49,7 +49,17 @@ class MemberPersistenceAdapterTest : FreeSpec({ member.receiveCoupon(나눠준_비율_할인_쿠폰) val unusedCouponEntity = fromCoupon(나눠준_비율_할인_쿠폰) - every { memberCouponRepository.findByMemberIdAndCoupon(member.id, unusedCouponEntity) } + every { + memberCouponRepository.findByMemberIdAndCoupon( + member.id, + unusedCouponEntity + ) + } returns MemberCouponEntity( + unusedCouponEntity, + member.id, + MemberCouponUseState.UNUSED, + 1L + ) memberPersistenceAdapter.updateUnusedCouponBook(member.id, member.showMyCouponBook()) } }