diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9912039e..f87d5ae2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] kotlin = "2.1.0" -kotest = "6.0.0.M1" +kotest = "6.0.0.M2" detekt = "1.23.7" ktlint = "1.1.0" okio = "3.10.2" diff --git a/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/base/JsonSchemaLoaderTest.kt b/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/base/JsonSchemaLoaderTest.kt index 1929414a..dd265a5e 100644 --- a/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/base/JsonSchemaLoaderTest.kt +++ b/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/base/JsonSchemaLoaderTest.kt @@ -13,7 +13,6 @@ import io.github.optimumcode.json.schema.ValidationError import io.github.optimumcode.json.schema.model.AbstractElement import io.github.optimumcode.json.schema.model.PrimitiveElement import io.kotest.assertions.assertSoftly -import io.kotest.assertions.throwables.shouldNotThrowAny import io.kotest.assertions.throwables.shouldNotThrowAnyUnit import io.kotest.assertions.throwables.shouldThrow import io.kotest.assertions.withClue @@ -315,31 +314,29 @@ class JsonSchemaLoaderTest : FunSpec() { // https://github.com/OptimumCode/json-schema-validator/issues/87 test("BUG_87 relative uri-ref in root \$id causes incorrect reference resolution for root schema") { val schema = - shouldNotThrowAny { - JsonSchemaLoader.create() - .register( - """ - { + JsonSchemaLoader.create() + .register( + """ + { + "${'$'}schema": "https://json-schema.org/draft/2020-12/schema", + "${'$'}id": "myproject/enums/foo", + "type": "integer" + } + """.trimIndent(), + ).fromDefinition( + """ + { "${'$'}schema": "https://json-schema.org/draft/2020-12/schema", - "${'$'}id": "myproject/enums/foo", - "type": "integer" - } - """.trimIndent(), - ).fromDefinition( - """ - { - "${'$'}schema": "https://json-schema.org/draft/2020-12/schema", - "${'$'}id": "myproject/data/request", - "type": "object", - "properties": { - "foobar": { - "${'$'}ref": "/myproject/enums/foo" - } - } - } - """.trimIndent(), - ) - } + "${'$'}id": "myproject/data/request", + "type": "object", + "properties": { + "foobar": { + "${'$'}ref": "/myproject/enums/foo" + } + } + } + """.trimIndent(), + ) val errors = mutableListOf() val valid = diff --git a/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/extension/JsonSchemaExtensionTest.kt b/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/extension/JsonSchemaExtensionTest.kt index 15808ff3..db7973a3 100644 --- a/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/extension/JsonSchemaExtensionTest.kt +++ b/json-schema-validator/src/commonTest/kotlin/io/github/optimumcode/json/schema/extension/JsonSchemaExtensionTest.kt @@ -8,7 +8,6 @@ import io.github.optimumcode.json.schema.ValidationError import io.github.optimumcode.json.schema.model.AbstractElement import io.github.optimumcode.json.schema.model.PrimitiveElement import io.kotest.assertions.assertSoftly -import io.kotest.assertions.throwables.shouldNotThrowAny import io.kotest.assertions.throwables.shouldThrow import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec @@ -98,23 +97,19 @@ class JsonSchemaExtensionTest : FunSpec() { test("registers all extensions with varargs") { val schema = - shouldNotThrowAny { - JsonSchemaLoader - .create() - .withExtensions(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory) - .fromDefinition(schemaDef) - } + JsonSchemaLoader + .create() + .withExtensions(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory) + .fromDefinition(schemaDef) checkValidAndInvalid(schema) } test("registers all extensions with iterable") { val schema = - shouldNotThrowAny { - JsonSchemaLoader - .create() - .withExtensions(listOf(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory)) - .fromDefinition(schemaDef) - } + JsonSchemaLoader + .create() + .withExtensions(listOf(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory)) + .fromDefinition(schemaDef) checkValidAndInvalid(schema) } } diff --git a/test-suites/src/commonTest/kotlin/io/github/optimumcode/json/schema/suite/AbstractSchemaTestSuite.kt b/test-suites/src/commonTest/kotlin/io/github/optimumcode/json/schema/suite/AbstractSchemaTestSuite.kt index 874e3135..507c3482 100644 --- a/test-suites/src/commonTest/kotlin/io/github/optimumcode/json/schema/suite/AbstractSchemaTestSuite.kt +++ b/test-suites/src/commonTest/kotlin/io/github/optimumcode/json/schema/suite/AbstractSchemaTestSuite.kt @@ -8,7 +8,6 @@ import io.github.optimumcode.json.schema.JsonSchema import io.github.optimumcode.json.schema.JsonSchemaLoader import io.github.optimumcode.json.schema.SchemaOption import io.github.optimumcode.json.schema.SchemaType -import io.kotest.assertions.throwables.shouldNotThrowAny import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe @@ -235,12 +234,8 @@ private fun FunSpec.executeFromDirectory( test("$testSuiteID at index $testSuiteIndex test $testIndex") { withClue(listOf(testSuite.description, testSuite.schema, test.description, test.data)) { val schema: JsonSchema = - shouldNotThrowAny { - schemaLoader.fromJsonElement(testSuite.schema, schemaType) - } - shouldNotThrowAny { - schema.validate(test.data, ErrorCollector.EMPTY) - } shouldBe test.valid + schemaLoader.fromJsonElement(testSuite.schema, schemaType) + schema.validate(test.data, ErrorCollector.EMPTY) shouldBe test.valid } } }