From e8ed27394393cdab7373573e622b0b791bff7367 Mon Sep 17 00:00:00 2001 From: pricelees Date: Sat, 13 Sep 2025 18:31:41 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=98=88=EC=95=BD=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=EC=9D=98=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=EB=8A=94=20?= =?UTF-8?q?=EB=B9=84=ED=9A=8C=EC=9B=90=EB=8F=84=20=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roomescape/schedule/docs/ScheduleAPI.kt | 9 +++-- .../roomescape/schedule/ScheduleApiTest.kt | 40 ------------------- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/src/main/kotlin/roomescape/schedule/docs/ScheduleAPI.kt b/src/main/kotlin/roomescape/schedule/docs/ScheduleAPI.kt index 69a0816e..f2f014ce 100644 --- a/src/main/kotlin/roomescape/schedule/docs/ScheduleAPI.kt +++ b/src/main/kotlin/roomescape/schedule/docs/ScheduleAPI.kt @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestParam import roomescape.admin.infrastructure.persistence.Privilege import roomescape.auth.web.support.AdminOnly +import roomescape.auth.web.support.Public import roomescape.auth.web.support.UserOnly import roomescape.common.dto.response.CommonApiResponse import roomescape.schedule.web.* @@ -18,15 +19,15 @@ import java.time.LocalDate interface ScheduleAPI { - @UserOnly - @Operation(summary = "입력된 날짜에 가능한 테마 목록 조회", tags = ["로그인이 필요한 API"]) + @Public + @Operation(summary = "입력된 날짜에 가능한 테마 목록 조회") @ApiResponses(ApiResponse(responseCode = "200", description = "입력된 날짜에 가능한 테마 목록 조회", useReturnTypeSchema = true)) fun findAvailableThemes( @RequestParam("date") @DateTimeFormat(pattern = "yyyy-MM-dd") date: LocalDate ): ResponseEntity> - @UserOnly - @Operation(summary = "입력된 날짜, 테마에 대한 모든 시간 조회", tags = ["로그인이 필요한 API"]) + @Public + @Operation(summary = "입력된 날짜, 테마에 대한 모든 시간 조회") @ApiResponses( ApiResponse( responseCode = "200", diff --git a/src/test/kotlin/roomescape/schedule/ScheduleApiTest.kt b/src/test/kotlin/roomescape/schedule/ScheduleApiTest.kt index 1f263f42..faa26730 100644 --- a/src/test/kotlin/roomescape/schedule/ScheduleApiTest.kt +++ b/src/test/kotlin/roomescape/schedule/ScheduleApiTest.kt @@ -31,25 +31,6 @@ class ScheduleApiTest( val date = LocalDate.now().plusDays(1) val endpoint = "/schedules/themes?date=$date" - context("권한이 없으면 접근할 수 없다.") { - test("관리자") { - runExceptionTest( - token = authUtil.defaultAdminLogin(), - method = HttpMethod.GET, - endpoint = endpoint, - expectedErrorCode = AuthErrorCode.ACCESS_DENIED - ) - } - - test("비회원") { - runExceptionTest( - method = HttpMethod.GET, - endpoint = endpoint, - expectedErrorCode = AuthErrorCode.TOKEN_NOT_FOUND - ) - } - } - test("정상 응답") { val adminToken = authUtil.defaultAdminLogin() @@ -77,27 +58,6 @@ class ScheduleApiTest( } context("동일한 날짜, 테마에 대한 모든 시간을 조회한다.") { - context("권한이 없으면 접근할 수 없다.") { - val endpoint = "/schedules?date=2025-09-12&themeId=12345" - - test("관리자") { - runExceptionTest( - token = authUtil.defaultAdminLogin(), - method = HttpMethod.GET, - endpoint = endpoint, - expectedErrorCode = AuthErrorCode.ACCESS_DENIED - ) - } - - test("비회원") { - runExceptionTest( - method = HttpMethod.GET, - endpoint = endpoint, - expectedErrorCode = AuthErrorCode.TOKEN_NOT_FOUND - ) - } - - } test("정상 응답") { val date = LocalDate.now().plusDays(1)