From c84355a76bf491ab53b6faa11ae97d72823c8476 Mon Sep 17 00:00:00 2001 From: seokjin8678 Date: Wed, 15 May 2024 08:46:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B6=95=EC=A0=9C=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EA=B3=B5=EC=97=B0=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EC=A0=95=EB=A0=AC=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 식별자 -> 시작 시간 --- .../FestivalDetailV1QueryDslRepository.java | 2 +- ...stivalDetailV1QueryServiceIntegrationTest.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/com/festago/festival/repository/FestivalDetailV1QueryDslRepository.java b/backend/src/main/java/com/festago/festival/repository/FestivalDetailV1QueryDslRepository.java index ddb1eb2ae..73380c8ec 100644 --- a/backend/src/main/java/com/festago/festival/repository/FestivalDetailV1QueryDslRepository.java +++ b/backend/src/main/java/com/festago/festival/repository/FestivalDetailV1QueryDslRepository.java @@ -64,7 +64,7 @@ public Optional findFestivalDetail(Long festivalId) { stage.id, stage.startTime, stageQueryInfo.artistInfo - ).skipNulls(), Comparator.comparingLong(StageV1Response::id)) + ).skipNulls(), Comparator.comparing(StageV1Response::startDateTime)) ) ) ); diff --git a/backend/src/test/java/com/festago/festival/application/integration/query/FestivalDetailV1QueryServiceIntegrationTest.java b/backend/src/test/java/com/festago/festival/application/integration/query/FestivalDetailV1QueryServiceIntegrationTest.java index af1631c77..2c087b700 100644 --- a/backend/src/test/java/com/festago/festival/application/integration/query/FestivalDetailV1QueryServiceIntegrationTest.java +++ b/backend/src/test/java/com/festago/festival/application/integration/query/FestivalDetailV1QueryServiceIntegrationTest.java @@ -1,5 +1,6 @@ package com.festago.festival.application.integration.query; +import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.SoftAssertions.assertSoftly; @@ -10,6 +11,7 @@ import com.festago.festival.application.FestivalDetailV1QueryService; import com.festago.festival.domain.Festival; import com.festago.festival.dto.SocialMediaV1Response; +import com.festago.festival.dto.StageV1Response; import com.festago.festival.repository.FestivalRepository; import com.festago.school.domain.School; import com.festago.school.repository.SchoolRepository; @@ -28,6 +30,7 @@ import com.festago.support.fixture.StageArtistFixture; import com.festago.support.fixture.StageFixture; import java.time.LocalDate; +import java.time.LocalDateTime; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.DisplayNameGenerator; @@ -174,6 +177,18 @@ private School createSchool(String schoolName, String domain) { }); } + @Test + void 공연_목록은_공연의_시작_시간_기준으로_정렬된다() { + // when + var response = festivalDetailV1QueryService.findFestivalDetail(테코대학교_축제.getId()); + + // then + assertThat(response.stages()) + .map(StageV1Response::startDateTime) + .map(LocalDateTime::toLocalDate) + .containsExactly(now, now.plusDays(1), now.plusDays(2)); + } + @Test void 축제에_공연이_없으면_응답의_공연에는_비어있는_컬렉션이_반환된다() { // when