File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
json-schema-validator/src/jvmTest/kotlin/io/github/optimumcode/json/schema Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import io.kotest.assertions.asClue
44import io.kotest.assertions.throwables.shouldNotThrowAny
55import io.kotest.core.spec.style.FunSpec
66import kotlinx.serialization.ExperimentalSerializationApi
7+ import java.io.ByteArrayInputStream
78import java.net.URI
89import java.net.http.HttpClient
910import java.net.http.HttpRequest
@@ -28,11 +29,14 @@ class JsonSchemaStreamTest : FunSpec() {
2829 .timeout(Duration .ofSeconds(10 ))
2930 .header(" User-Agent" , " Mozilla/5.0" )
3031 .build(),
31- BodyHandlers .ofInputStream (),
32+ BodyHandlers .ofByteArray (),
3233 )
34+ val body = response.body()
3335 " Response code: ${response.statusCode()} " .asClue {
34- shouldNotThrowAny {
35- response.body().use(JsonSchema ::fromStream)
36+ body.toString(Charsets .UTF_8 ).asClue {
37+ shouldNotThrowAny {
38+ JsonSchema .fromStream(ByteArrayInputStream (body))
39+ }
3640 }
3741 }
3842 }
You can’t perform that action at this time.
0 commit comments