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 ""
|
||||
}
|
||||
}
|
||||
|
||||
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를 쿠키로 반환한다.") {
|
||||
@ -41,11 +50,11 @@ class CookieUtilsTest : FunSpec({
|
||||
val result: String = tokenResponse.toResponseCookie()
|
||||
|
||||
result.split("; ") shouldContainAll listOf(
|
||||
"accessToken=test-token",
|
||||
"HttpOnly",
|
||||
"Secure",
|
||||
"Path=/",
|
||||
"Max-Age=1800"
|
||||
"accessToken=test-token",
|
||||
"HttpOnly",
|
||||
"Secure",
|
||||
"Path=/",
|
||||
"Max-Age=1800"
|
||||
)
|
||||
}
|
||||
|
||||
@ -53,11 +62,11 @@ class CookieUtilsTest : FunSpec({
|
||||
val result: String = expiredAccessTokenCookie()
|
||||
|
||||
result.split("; ") shouldContainAll listOf(
|
||||
"accessToken=",
|
||||
"HttpOnly",
|
||||
"Secure",
|
||||
"Path=/",
|
||||
"Max-Age=0"
|
||||
"accessToken=",
|
||||
"HttpOnly",
|
||||
"Secure",
|
||||
"Path=/",
|
||||
"Max-Age=0"
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user