Skip to content

Commit 78b3f20

Browse files
committed
Add tests for HttpHeadersBuilder toString method.
1 parent 88d2bb8 commit 78b3f20

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/kotlin/io/github/nstdio/http/ext/HttpHeadersBuilderTest.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ package io.github.nstdio.http.ext
1717

1818
import io.github.nstdio.http.ext.Assertions.assertThat
1919
import io.kotest.matchers.maps.shouldBeEmpty
20+
import io.kotest.matchers.should
21+
import io.kotest.matchers.string.shouldEndWith
22+
import io.kotest.matchers.string.shouldStartWith
2023
import io.kotest.matchers.types.shouldBeSameInstanceAs
2124
import org.junit.jupiter.api.BeforeEach
2225
import org.junit.jupiter.api.Test
@@ -139,4 +142,18 @@ internal class HttpHeadersBuilderTest {
139142
h1 shouldBeSameInstanceAs h2
140143
h1.map().shouldBeEmpty()
141144
}
145+
146+
@Test
147+
fun `Should have proper toString`() {
148+
//when
149+
builder
150+
.add("b", listOf("3", "4"))
151+
.add("a", listOf("1", "2"))
152+
153+
//then
154+
builder.toString().should {
155+
it shouldStartWith "${HttpHeadersBuilder::class.qualifiedName}@"
156+
it shouldEndWith "{ {a=[1, 2], b=[3, 4]} }"
157+
}
158+
}
142159
}

0 commit comments

Comments
 (0)