From 4db2b11970ef8693d6c3ea765a3defd7d11bdd60 Mon Sep 17 00:00:00 2001 From: pricelees Date: Tue, 29 Jul 2025 14:02:04 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=9D=B8=EC=A6=9D=20=EB=8B=A8?= =?UTF-8?q?=EA=B3=84=EC=97=90=EC=84=9C=20=ED=9A=8C=EC=9B=90=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=8B=A4=ED=8C=A8=20=EC=98=A4=EB=A5=98=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95(->=20MEMBER=5FNOT=5FFOUND)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/roomescape/auth/business/AuthService.kt | 2 +- src/main/kotlin/roomescape/auth/exception/AuthErrorCode.kt | 2 +- src/test/kotlin/roomescape/auth/business/AuthServiceTest.kt | 2 +- src/test/kotlin/roomescape/auth/web/AuthControllerTest.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/roomescape/auth/business/AuthService.kt b/src/main/kotlin/roomescape/auth/business/AuthService.kt index bf648349..b28e6c7c 100644 --- a/src/main/kotlin/roomescape/auth/business/AuthService.kt +++ b/src/main/kotlin/roomescape/auth/business/AuthService.kt @@ -36,7 +36,7 @@ class AuthService( fun checkLogin(memberId: Long): LoginCheckResponse { log.debug { "[AuthService.checkLogin] 로그인 확인 시작: memberId=$memberId" } val member: MemberEntity = - fetchMemberOrThrow(AuthErrorCode.UNIDENTIFIABLE_MEMBER, "memberId=$memberId", "checkLogin") { + fetchMemberOrThrow(AuthErrorCode.MEMBER_NOT_FOUND, "memberId=$memberId", "checkLogin") { memberService.findById(memberId) } diff --git a/src/main/kotlin/roomescape/auth/exception/AuthErrorCode.kt b/src/main/kotlin/roomescape/auth/exception/AuthErrorCode.kt index 7c585267..1fdc7f06 100644 --- a/src/main/kotlin/roomescape/auth/exception/AuthErrorCode.kt +++ b/src/main/kotlin/roomescape/auth/exception/AuthErrorCode.kt @@ -13,5 +13,5 @@ enum class AuthErrorCode( EXPIRED_TOKEN(HttpStatus.UNAUTHORIZED, "A003", "토큰이 만료됐어요."), ACCESS_DENIED(HttpStatus.FORBIDDEN, "A004", "접근 권한이 없어요."), LOGIN_FAILED(HttpStatus.UNAUTHORIZED, "A005", "이메일과 비밀번호를 확인해주세요."), - UNIDENTIFIABLE_MEMBER(HttpStatus.UNAUTHORIZED, "A006", "회원 정보를 찾을 수 없어요."), + MEMBER_NOT_FOUND(HttpStatus.UNAUTHORIZED, "A006", "회원 정보를 찾을 수 없어요."), } diff --git a/src/test/kotlin/roomescape/auth/business/AuthServiceTest.kt b/src/test/kotlin/roomescape/auth/business/AuthServiceTest.kt index 587d1ded..8d629510 100644 --- a/src/test/kotlin/roomescape/auth/business/AuthServiceTest.kt +++ b/src/test/kotlin/roomescape/auth/business/AuthServiceTest.kt @@ -74,7 +74,7 @@ class AuthServiceTest : BehaviorSpec({ authService.checkLogin(userId) } - exception.errorCode shouldBe AuthErrorCode.UNIDENTIFIABLE_MEMBER + exception.errorCode shouldBe AuthErrorCode.MEMBER_NOT_FOUND } } } diff --git a/src/test/kotlin/roomescape/auth/web/AuthControllerTest.kt b/src/test/kotlin/roomescape/auth/web/AuthControllerTest.kt index 03ee82bd..0e895d9d 100644 --- a/src/test/kotlin/roomescape/auth/web/AuthControllerTest.kt +++ b/src/test/kotlin/roomescape/auth/web/AuthControllerTest.kt @@ -114,7 +114,7 @@ class AuthControllerTest( every { memberRepository.findByIdOrNull(invalidMemberId) } returns null Then("에러 응답을 받는다.") { - val expectedError = AuthErrorCode.UNIDENTIFIABLE_MEMBER + val expectedError = AuthErrorCode.MEMBER_NOT_FOUND runGetTest( mockMvc = mockMvc, endpoint = endpoint,