Skip to content

Commit b4aae7a

Browse files
committed
Improve cookies test
Signed-off-by: Dmitry Sulman <[email protected]>
1 parent bbfdecc commit b4aae7a

File tree

1 file changed

+7
-1
lines changed
  • logback-access-reactor-netty/src/test/kotlin/io/github/dmitrysulman/logback/access/reactor/netty

1 file changed

+7
-1
lines changed

logback-access-reactor-netty/src/test/kotlin/io/github/dmitrysulman/logback/access/reactor/netty/AccessEventTests.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,20 @@ class AccessEventTests {
379379
}
380380

381381
@Test
382-
fun `should not throw on null or blank cookie name`() {
382+
fun `should not throw on null or blank or illegal cookie`() {
383383
val mockContext = mockk<AccessContext>(relaxed = true)
384384
val mockArgProvider = mockk<AccessLogArgProvider>(relaxed = true)
385+
val cookieWithNullValue = mockk<DefaultCookie>()
386+
every { cookieWithNullValue.value() } returns null
385387
every { mockArgProvider.cookies() } returns
386388
mapOf(
387389
null to setOf(DefaultCookie(COOKIE, VALUE)),
388390
"" to setOf(DefaultCookie(COOKIE, VALUE)),
389391
" " to setOf(DefaultCookie(COOKIE, VALUE)),
392+
"()<>@,;:" to setOf(DefaultCookie(COOKIE, VALUE)),
393+
"empty" to emptySet(),
394+
"null" to setOf(null),
395+
"nullValue" to setOf(cookieWithNullValue),
390396
"cookie1" to setOf(DefaultCookie("cookie1", "value1")),
391397
)
392398

0 commit comments

Comments
 (0)