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)