From 4d4b8bea1be0570ee72c4a2eea779129fd0fdcfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:16:52 +0000 Subject: [PATCH 1/2] Bump kotest from 6.0.0.M1 to 6.0.0.M2 Bumps `kotest` from 6.0.0.M1 to 6.0.0.M2. Updates `io.kotest:kotest-assertions-core` from 6.0.0.M1 to 6.0.0.M2 - [Release notes](https://github.com/kotest/kotest/releases) - [Commits](https://github.com/kotest/kotest/commits) Updates `io.kotest:kotest-framework-engine` from 6.0.0.M1 to 6.0.0.M2 - [Release notes](https://github.com/kotest/kotest/releases) - [Commits](https://github.com/kotest/kotest/commits) Updates `io.kotest:kotest-runner-junit5` from 6.0.0.M1 to 6.0.0.M2 - [Release notes](https://github.com/kotest/kotest/releases) - [Commits](https://github.com/kotest/kotest/commits) Updates `io.kotest.multiplatform` from 6.0.0.M1 to 6.0.0.M2 --- updated-dependencies: - dependency-name: io.kotest:kotest-assertions-core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.kotest:kotest-framework-engine dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.kotest:kotest-runner-junit5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.kotest.multiplatform dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From e0caa084936e99bb70a7e3d55d01f067f1a2b9bf Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Sat, 8 Feb 2025 19:11:02 +0400 Subject: [PATCH 2/2] Remove shouldNotThrowAny from test where the returned value is used later --- .../json/schema/base/JsonSchemaLoaderTest.kt | 47 +++++++++---------- .../extension/JsonSchemaExtensionTest.kt | 21 ++++----- .../schema/suite/AbstractSchemaTestSuite.kt | 9 +--- 3 files changed, 32 insertions(+), 45 deletions(-) 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 } } }