generated from pricelees/issue-pr-template
refactor: 인증 단계에서 회원 조회 실패 오류 코드 수정(-> MEMBER_NOT_FOUND)
This commit is contained in:
parent
fd639001e9
commit
4db2b11970
@ -36,7 +36,7 @@ class AuthService(
|
|||||||
fun checkLogin(memberId: Long): LoginCheckResponse {
|
fun checkLogin(memberId: Long): LoginCheckResponse {
|
||||||
log.debug { "[AuthService.checkLogin] 로그인 확인 시작: memberId=$memberId" }
|
log.debug { "[AuthService.checkLogin] 로그인 확인 시작: memberId=$memberId" }
|
||||||
val member: MemberEntity =
|
val member: MemberEntity =
|
||||||
fetchMemberOrThrow(AuthErrorCode.UNIDENTIFIABLE_MEMBER, "memberId=$memberId", "checkLogin") {
|
fetchMemberOrThrow(AuthErrorCode.MEMBER_NOT_FOUND, "memberId=$memberId", "checkLogin") {
|
||||||
memberService.findById(memberId)
|
memberService.findById(memberId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,5 +13,5 @@ enum class AuthErrorCode(
|
|||||||
EXPIRED_TOKEN(HttpStatus.UNAUTHORIZED, "A003", "토큰이 만료됐어요."),
|
EXPIRED_TOKEN(HttpStatus.UNAUTHORIZED, "A003", "토큰이 만료됐어요."),
|
||||||
ACCESS_DENIED(HttpStatus.FORBIDDEN, "A004", "접근 권한이 없어요."),
|
ACCESS_DENIED(HttpStatus.FORBIDDEN, "A004", "접근 권한이 없어요."),
|
||||||
LOGIN_FAILED(HttpStatus.UNAUTHORIZED, "A005", "이메일과 비밀번호를 확인해주세요."),
|
LOGIN_FAILED(HttpStatus.UNAUTHORIZED, "A005", "이메일과 비밀번호를 확인해주세요."),
|
||||||
UNIDENTIFIABLE_MEMBER(HttpStatus.UNAUTHORIZED, "A006", "회원 정보를 찾을 수 없어요."),
|
MEMBER_NOT_FOUND(HttpStatus.UNAUTHORIZED, "A006", "회원 정보를 찾을 수 없어요."),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class AuthServiceTest : BehaviorSpec({
|
|||||||
authService.checkLogin(userId)
|
authService.checkLogin(userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
exception.errorCode shouldBe AuthErrorCode.UNIDENTIFIABLE_MEMBER
|
exception.errorCode shouldBe AuthErrorCode.MEMBER_NOT_FOUND
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ class AuthControllerTest(
|
|||||||
every { memberRepository.findByIdOrNull(invalidMemberId) } returns null
|
every { memberRepository.findByIdOrNull(invalidMemberId) } returns null
|
||||||
|
|
||||||
Then("에러 응답을 받는다.") {
|
Then("에러 응답을 받는다.") {
|
||||||
val expectedError = AuthErrorCode.UNIDENTIFIABLE_MEMBER
|
val expectedError = AuthErrorCode.MEMBER_NOT_FOUND
|
||||||
runGetTest(
|
runGetTest(
|
||||||
mockMvc = mockMvc,
|
mockMvc = mockMvc,
|
||||||
endpoint = endpoint,
|
endpoint = endpoint,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user