Skip to content

Commit

Permalink
fix: 축제 상세 조회 시 공연 목록 정렬 조건 수정
Browse files Browse the repository at this point in the history
- 식별자 -> 시작 시간
  • Loading branch information
seokjin8678 committed May 14, 2024
1 parent 30fc51e commit a5f5041
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
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.application.command.FestivalCreateService;
import com.festago.festival.dto.SocialMediaV1Response;
import com.festago.festival.dto.StageV1Response;
import com.festago.festival.dto.command.FestivalCreateCommand;
import com.festago.school.application.SchoolCommandService;
import com.festago.school.domain.SchoolRegion;
Expand Down Expand Up @@ -83,10 +85,10 @@ void setUp() {

LocalDateTime ticketOpenTime = now.minusWeeks(1).atStartOfDay();
stageCreateService.createStage(new StageCreateCommand(
테코대학교_축제_식별자, now.atTime(18, 0), ticketOpenTime, List.of(아티스트_식별자)
테코대학교_축제_식별자, now.plusDays(1).atTime(18, 0), ticketOpenTime, List.of(아티스트_식별자)
));
stageCreateService.createStage(new StageCreateCommand(
테코대학교_축제_식별자, now.plusDays(1).atTime(18, 0), ticketOpenTime, List.of(아티스트_식별자)
테코대학교_축제_식별자, now.atTime(18, 0), ticketOpenTime, List.of(아티스트_식별자)
));
stageCreateService.createStage(new StageCreateCommand(
테코대학교_축제_식별자, now.plusDays(2).atTime(18, 0), ticketOpenTime, List.of(아티스트_식별자)
Expand Down Expand Up @@ -145,6 +147,18 @@ private Long createSchool(String schoolName, String domain) {
});
}

@Test
void 공연_목록은_공연의_시작_시간_기준으로_정렬된다() {
// when
var response = festivalDetailV1QueryService.findFestivalDetail(테코대학교_축제_식별자);

// 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 a5f5041

Please sign in to comment.