File tree Expand file tree Collapse file tree 1 file changed +19
-11
lines changed
json-schema-validator/src/jvmTest/kotlin/io/github/optimumcode/json/schema Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change 1
1
package io.github.optimumcode.json.schema
2
2
3
+ import io.kotest.assertions.asClue
3
4
import io.kotest.assertions.throwables.shouldNotThrowAny
4
5
import io.kotest.core.spec.style.FunSpec
5
6
import kotlinx.serialization.ExperimentalSerializationApi
@@ -14,17 +15,24 @@ import java.time.Duration
14
15
class JsonSchemaStreamTest : FunSpec () {
15
16
init {
16
17
test(" definition is loaded from input stream" ) {
17
- shouldNotThrowAny {
18
- val client = HttpClient .newHttpClient()
19
- val response =
20
- client.send(
21
- HttpRequest .newBuilder(URI .create(" https://json-schema.org/draft-07/schema#" ))
22
- .GET ()
23
- .timeout(Duration .ofSeconds(10 ))
24
- .build(),
25
- BodyHandlers .ofInputStream(),
26
- )
27
- response.body().use(JsonSchema ::fromStream)
18
+
19
+ val client =
20
+ HttpClient .newBuilder()
21
+ .followRedirects(HttpClient .Redirect .NORMAL )
22
+ .build()
23
+
24
+ val response =
25
+ client.send(
26
+ HttpRequest .newBuilder(URI .create(" https://json-schema.org/draft-07/schema#" ))
27
+ .GET ()
28
+ .timeout(Duration .ofSeconds(10 ))
29
+ .build(),
30
+ BodyHandlers .ofInputStream(),
31
+ )
32
+ " Response code: ${response.statusCode()} " .asClue {
33
+ shouldNotThrowAny {
34
+ response.body().use(JsonSchema ::fromStream)
35
+ }
28
36
}
29
37
}
30
38
}
You can’t perform that action at this time.
0 commit comments