From 2d08a20affee084567472723518d5ed920aad1f4 Mon Sep 17 00:00:00 2001 From: pricelees Date: Fri, 19 Sep 2025 18:39:51 +0900 Subject: [PATCH] =?UTF-8?q?test:=20Schedule=20=EB=B0=8F=20Reservation?= =?UTF-8?q?=EC=97=90=EC=84=9C=EC=9D=98=20=EB=B3=80=EA=B2=BD=20=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedule/business/ScheduleService.kt | 20 +++++++++---------- .../reservation/ReservationApiTest.kt | 8 +++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt b/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt index e080dae5..e72f7c6d 100644 --- a/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt +++ b/src/main/kotlin/roomescape/schedule/business/ScheduleService.kt @@ -69,16 +69,6 @@ class ScheduleService( throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_AVAILABLE) } - @Transactional(readOnly = true) - fun findScheduleOverviewById(id: Long): ScheduleOverviewResponse { - val overview: ScheduleOverview = scheduleRepository.findOverviewByIdOrNull(id) ?: run { - log.warn { "[ScheduleService.findScheduleOverview] 일정 개요 조회 실패: id=$id" } - throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_FOUND) - } - - return overview.toOverviewResponse() - } - // ======================================== // All-Admin (본사, 매장 모두 사용가능) // ======================================== @@ -181,6 +171,16 @@ class ScheduleService( } } + @Transactional(readOnly = true) + fun findScheduleOverviewById(id: Long): ScheduleOverviewResponse { + val overview: ScheduleOverview = scheduleRepository.findOverviewByIdOrNull(id) ?: run { + log.warn { "[ScheduleService.findScheduleOverview] 일정 개요 조회 실패: id=$id" } + throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_FOUND) + } + + return overview.toOverviewResponse() + } + // ======================================== // Common (공통 메서드) // ======================================== diff --git a/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt b/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt index 92dc8da4..53be12c3 100644 --- a/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt +++ b/src/test/kotlin/roomescape/reservation/ReservationApiTest.kt @@ -338,13 +338,13 @@ class ReservationApiTest( runTest( token = userToken, on = { - get("/reservations/summary") + get("/reservations/overview") }, expect = { statusCode(HttpStatus.OK.value()) body("data.reservations.size()", equalTo(3)) assertProperties( - props = setOf("id", "themeName", "date", "startAt", "status"), + props = setOf("id", "storeName", "themeName", "date", "startFrom", "endAt", "status"), propsNameIfList = "reservations" ) } @@ -596,7 +596,9 @@ class ReservationApiTest( }, expect = { statusCode(HttpStatus.OK.value()) - assertProperties(props = setOf("id", "user", "applicationDateTime", "payment")) + assertProperties(props = setOf("id", "reserver", "user", "applicationDateTime", "payment")) + assertProperties(props = setOf("name", "contact", "participantCount", "requirement"), propsNameIfList = "reserver") + assertProperties(props = setOf("id", "name", "phone"), propsNameIfList = "user") } ).also { it.extract().path("data.id") shouldBe reservation.id