generated from pricelees/issue-pr-template
test: CookieUtilsTest에 null 반환 테스트 추가
This commit is contained in:
parent
fd9f0e0cea
commit
0cc69179d1
@ -33,6 +33,15 @@ class CookieUtilsTest : FunSpec({
|
|||||||
this.value shouldBe ""
|
this.value shouldBe ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test("httpServletRequest.cookies가 null이면 accessToken에 빈 값을 담은 쿠키를 반환한다.") {
|
||||||
|
every { httpServletRequest.cookies } returns null
|
||||||
|
|
||||||
|
assertSoftly(httpServletRequest.accessTokenCookie()) {
|
||||||
|
this.name shouldBe ACCESS_TOKEN_COOKIE_NAME
|
||||||
|
this.value shouldBe ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
context("TokenResponse를 쿠키로 반환한다.") {
|
context("TokenResponse를 쿠키로 반환한다.") {
|
||||||
@ -41,11 +50,11 @@ class CookieUtilsTest : FunSpec({
|
|||||||
val result: String = tokenResponse.toResponseCookie()
|
val result: String = tokenResponse.toResponseCookie()
|
||||||
|
|
||||||
result.split("; ") shouldContainAll listOf(
|
result.split("; ") shouldContainAll listOf(
|
||||||
"accessToken=test-token",
|
"accessToken=test-token",
|
||||||
"HttpOnly",
|
"HttpOnly",
|
||||||
"Secure",
|
"Secure",
|
||||||
"Path=/",
|
"Path=/",
|
||||||
"Max-Age=1800"
|
"Max-Age=1800"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,11 +62,11 @@ class CookieUtilsTest : FunSpec({
|
|||||||
val result: String = expiredAccessTokenCookie()
|
val result: String = expiredAccessTokenCookie()
|
||||||
|
|
||||||
result.split("; ") shouldContainAll listOf(
|
result.split("; ") shouldContainAll listOf(
|
||||||
"accessToken=",
|
"accessToken=",
|
||||||
"HttpOnly",
|
"HttpOnly",
|
||||||
"Secure",
|
"Secure",
|
||||||
"Path=/",
|
"Path=/",
|
||||||
"Max-Age=0"
|
"Max-Age=0"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user