generated from pricelees/issue-pr-template
[#34] 회원 / 인증 도메인 재정의 #43
@ -52,12 +52,8 @@ class JwtUtilsTest : FunSpec() {
|
||||
}
|
||||
}
|
||||
|
||||
test("claim에 입력된 key의 정보가 없으면 실패한다.") {
|
||||
shouldThrow<AuthException> {
|
||||
jwtUtils.extractClaim(token = commonToken, key = "abcde")
|
||||
}.also {
|
||||
it.errorCode shouldBe AuthErrorCode.INVALID_TOKEN
|
||||
}
|
||||
test("claim에 입력된 key의 정보가 없으면 null을 반환한다.") {
|
||||
jwtUtils.extractClaim(token = commonToken, key = "abcde") shouldBe null
|
||||
}
|
||||
|
||||
test("토큰이 만료되면 실패한다.") {
|
||||
|
||||
@ -15,12 +15,12 @@ class ApiLogMessageConverterTest : StringSpec({
|
||||
val request: HttpServletRequest = mockk()
|
||||
|
||||
beforeTest {
|
||||
MDC.remove("member_id")
|
||||
MDC.put("member_id", "1")
|
||||
MDC.remove("principal_id")
|
||||
MDC.put("principal_id", "1")
|
||||
}
|
||||
|
||||
afterSpec {
|
||||
MDC.remove("member_id")
|
||||
MDC.remove("principal_id")
|
||||
}
|
||||
|
||||
"HTTP 요청 메시지를 변환한다." {
|
||||
@ -44,7 +44,7 @@ class ApiLogMessageConverterTest : StringSpec({
|
||||
val requestURI = "/test/sangdol".also { every { request.requestURI } returns it }
|
||||
|
||||
converter.convertToControllerInvokedMessage(request, controllerPayload) shouldBe """
|
||||
{"type":"CONTROLLER_INVOKED","method":"$method","uri":"$requestURI","member_id":1,"controller_method":"${
|
||||
{"type":"CONTROLLER_INVOKED","method":"$method","uri":"$requestURI","principal_id":1,"controller_method":"${
|
||||
controllerPayload.get(
|
||||
"controller_method"
|
||||
)
|
||||
@ -62,7 +62,7 @@ class ApiLogMessageConverterTest : StringSpec({
|
||||
)
|
||||
|
||||
converter.convertToResponseMessage(request) shouldBe """
|
||||
{"type":"CONTROLLER_SUCCESS","endpoint":"$endpoint","status_code":200,"member_id":1,"exception":{"class":"AuthException","message":"테스트 메시지!"}}
|
||||
{"type":"CONTROLLER_SUCCESS","endpoint":"$endpoint","status_code":200,"principal_id":1,"exception":{"class":"AuthException","message":"테스트 메시지!"}}
|
||||
""".trimIndent()
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user