Skip to content

Commit

Permalink
test12
Browse files Browse the repository at this point in the history
  • Loading branch information
70825 committed Apr 2, 2024
1 parent 8686231 commit 25513ad
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static com.funeat.fixture.ReviewFixture.리뷰추가요청_재구매O_생성;
import static com.funeat.fixture.TagFixture.태그_맛있어요_TASTE_생성;
import static com.funeat.fixture.TagFixture.태그_아침식사_ETC_생성;
import static com.funeat.review.exception.ReviewErrorCode.REVIEW_NOT_FOUND;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.SoftAssertions.assertSoftly;
Expand Down Expand Up @@ -397,9 +398,17 @@ class sortingReviews_성공_테스트 {
final var request = 리뷰정렬요청_최신순_생성(3L);

final var expected = List.of(review2.getId(), review1.getId());
Review review3_1 = reviewRepository.findById(3L)
.orElseThrow(() -> new ReviewNotFoundException(REVIEW_NOT_FOUND, 3L));

// when
final var actual = reviewService.sortingReviews(productId, memberId, request).getReviews();
if (actual.size() == 3) {
assertThat(review3_1.getCreatedAt()).isEqualTo(actual.get(0).getCreatedAt());
} else {
assertThat(actual.size()).isEqualTo(3L);
assertThat(review3_1.getCreatedAt()).isEqualTo(actual.get(0).getCreatedAt());
}

// then
assertThat(actual).extracting(SortingReviewDto::getId)
Expand Down

0 comments on commit 25513ad

Please sign in to comment.