Skip to content

Commit

Permalink
[BE] fix: 축제 상세 조회 시 공연 목록 시작 시간으로 정렬되도록 수정 (#967) (#968)
Browse files Browse the repository at this point in the history
fix: 축제 상세 조회 시 공연 목록 정렬 조건 수정

- 식별자 -> 시작 시간
  • Loading branch information
seokjin8678 authored May 15, 2024
1 parent f0e6f46 commit 75f69eb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Optional<FestivalDetailV1Response> findFestivalDetail(Long festivalId) {
stage.id,
stage.startTime,
stageQueryInfo.artistInfo
).skipNulls(), Comparator.comparingLong(StageV1Response::id))
).skipNulls(), Comparator.comparing(StageV1Response::startDateTime))
)
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 75f69eb

Please sign in to comment.