File tree 1 file changed +7
-3
lines changed
json-schema-validator/src/jvmTest/kotlin/io/github/optimumcode/json/schema
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
4
4
import io.kotest.assertions.throwables.shouldNotThrowAny
5
5
import io.kotest.core.spec.style.FunSpec
6
6
import kotlinx.serialization.ExperimentalSerializationApi
7
+ import java.io.ByteArrayInputStream
7
8
import java.net.URI
8
9
import java.net.http.HttpClient
9
10
import java.net.http.HttpRequest
@@ -28,11 +29,14 @@ class JsonSchemaStreamTest : FunSpec() {
28
29
.timeout(Duration .ofSeconds(10 ))
29
30
.header(" User-Agent" , " Mozilla/5.0" )
30
31
.build(),
31
- BodyHandlers .ofInputStream (),
32
+ BodyHandlers .ofByteArray (),
32
33
)
34
+ val body = response.body()
33
35
" 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
+ }
36
40
}
37
41
}
38
42
}
You can’t perform that action at this time.
0 commit comments