From 82db9f9454b7b77d8b752c41c762c752f2a01795 Mon Sep 17 00:00:00 2001 From: hanueleee Date: Wed, 18 Oct 2023 17:46:52 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EB=B9=84=EB=8F=99=EA=B8=B0=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EA=B2=80=EC=A6=9D=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReviewDeleteEventListenerTest.java | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/backend/src/test/java/com/funeat/review/application/ReviewDeleteEventListenerTest.java b/backend/src/test/java/com/funeat/review/application/ReviewDeleteEventListenerTest.java index 9f5dfb73..f62537ac 100644 --- a/backend/src/test/java/com/funeat/review/application/ReviewDeleteEventListenerTest.java +++ b/backend/src/test/java/com/funeat/review/application/ReviewDeleteEventListenerTest.java @@ -6,14 +6,10 @@ import static com.funeat.fixture.ProductFixture.상품_삼각김밥_가격1000원_평점2점_생성; import static com.funeat.fixture.ReviewFixture.리뷰_이미지test1_평점1점_재구매O_생성; import static com.funeat.fixture.ReviewFixture.리뷰_이미지test2_평점2점_재구매O_생성; -import static com.funeat.fixture.ReviewFixture.리뷰_이미지test3_평점3점_재구매O_생성; import static com.funeat.fixture.ReviewFixture.리뷰_이미지test4_평점4점_재구매O_생성; -import static com.funeat.fixture.ReviewFixture.리뷰_이미지없음_평점1점_재구매X_생성; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; import com.funeat.common.EventTest; import com.funeat.common.ImageUploader; @@ -86,48 +82,6 @@ class 리뷰_삭제_이벤트_발행 { @Nested class 이미지_삭제_로직_작동 { - @Test - void 리뷰_삭제가_정상적으로_커밋되고_이미지가_존재하면_이미지_삭제_로직이_작동한다() { - // given - final var author = 멤버_멤버1_생성(); - final var authorId = 단일_멤버_저장(author); - - final var category = 카테고리_즉석조리_생성(); - 단일_카테고리_저장(category); - - final var product = 상품_삼각김밥_가격1000원_평점2점_생성(category); - 단일_상품_저장(product); - - final var review = reviewRepository.save(리뷰_이미지test3_평점3점_재구매O_생성(author, product, 0L)); - - // when - reviewService.deleteReview(review.getId(), authorId); - - // then - verify(uploader, timeout(1000).times(1)).delete(any()); - } - - @Test - void 리뷰_삭제가_정상적으로_커밋되었지만_이미지가_존재하지_않으면_이미지_삭제_로직이_작동하지않는다() { - // given - final var author = 멤버_멤버1_생성(); - final var authorId = 단일_멤버_저장(author); - - final var category = 카테고리_즉석조리_생성(); - 단일_카테고리_저장(category); - - final var product = 상품_삼각김밥_가격1000원_평점2점_생성(category); - 단일_상품_저장(product); - - final var review = reviewRepository.save(리뷰_이미지없음_평점1점_재구매X_생성(author, product, 0L)); - - // when - reviewService.deleteReview(review.getId(), authorId); - - // then - verify(uploader, timeout(1000).times(0)).delete(any()); - } - @Test void 이미지_삭제_로직이_실패해도_메인로직까지_롤백되어서는_안된다() { // given