test: Schedule 및 Reservation에서의 변경 사항 테스트 반영

This commit is contained in:
이상진 2025-09-19 18:39:51 +09:00
parent c0df43f840
commit 2d08a20aff
2 changed files with 15 additions and 13 deletions

View File

@ -69,16 +69,6 @@ class ScheduleService(
throw ScheduleException(ScheduleErrorCode.SCHEDULE_NOT_AVAILABLE) 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 (본사, 매장 모두 사용가능) // 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 (공통 메서드) // Common (공통 메서드)
// ======================================== // ========================================

View File

@ -338,13 +338,13 @@ class ReservationApiTest(
runTest( runTest(
token = userToken, token = userToken,
on = { on = {
get("/reservations/summary") get("/reservations/overview")
}, },
expect = { expect = {
statusCode(HttpStatus.OK.value()) statusCode(HttpStatus.OK.value())
body("data.reservations.size()", equalTo(3)) body("data.reservations.size()", equalTo(3))
assertProperties( assertProperties(
props = setOf("id", "themeName", "date", "startAt", "status"), props = setOf("id", "storeName", "themeName", "date", "startFrom", "endAt", "status"),
propsNameIfList = "reservations" propsNameIfList = "reservations"
) )
} }
@ -596,7 +596,9 @@ class ReservationApiTest(
}, },
expect = { expect = {
statusCode(HttpStatus.OK.value()) 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 { ).also {
it.extract().path<Long>("data.id") shouldBe reservation.id it.extract().path<Long>("data.id") shouldBe reservation.id