From 0b64dbbc7dece6838a0495cfe04ff481d6a9a69a Mon Sep 17 00:00:00 2001 From: Lukas Cardot Date: Mon, 2 Sep 2024 17:13:53 -0400 Subject: [PATCH] upgrade dependencies --- gradle/libs.versions.toml | 40 +++++++++---------- jcv-db-cassandra/build.gradle.kts | 3 +- .../oss/jcv/db/DbComparatorAssertTest.kt | 23 ++++++----- .../com/ekino/oss/jcv/db/ValidatorsTest.kt | 31 ++++++++------ jcv-db-jdbc/build.gradle.kts | 2 - .../ekino/oss/jcv/db/mongo/ValidatorsTest.kt | 14 ++++--- 6 files changed, 57 insertions(+), 56 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f134249..09e57f5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,25 +1,22 @@ [versions] jcv-core = "1.5.0" -jsonassert = "1.5.0" -postgres = "42.5.0" +jsonassert = "1.5.3" +postgres = "42.7.4" mssql = "11.2.0.jre11" -mysql = "8.0.29" -junit = "5.9.0" -assertj-core = "3.24.2" +mysql = "8.4.0" +junit = "5.11.0" +assertj-core = "3.26.3" assertj-db = "2.0.2" -kotlin-jvm = "1.8.10" -dokka = "1.7.10" +kotlin-jvm = "1.9.25" +dokka = "1.9.20" researchgate-release = "3.0.2" kotlin-quality = "4.2.0" -java-driver-core = "4.15.0" -java-driver-query-builder = "4.17.0" -jackson-databind = "2.15.3" -jts-core = "1.19.0" -assertk-jvm = "0.25" -spring-jdbc = "5.3.23" -mongodb-driver = "4.9.0" - +cassandra-driver = "4.18.1" +jackson-databind = "2.17.2" +jts-core = "1.20.0" +assertk-jvm = "0.28.1" +mongodb-driver = "4.11.3" [libraries] @@ -29,20 +26,19 @@ jcv-core = { module = "com.ekino.oss.jcv:jcv-core", version.ref = "jcv-core" } jsonassert = { module = "org.skyscreamer:jsonassert", version.ref= "jsonassert" } assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" } assertj-db = { module = "org.assertj:assertj-db", version.ref = "assertj-db" } +assertk-jvm = { module = "com.willowtreeapps.assertk:assertk-jvm", version.ref = "assertk-jvm" } +junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } postgres = { module = "org.postgresql:postgresql", version.ref = "postgres" } mssql-jdbc = { module = "com.microsoft.sqlserver:mssql-jdbc", version.ref = "mssql" } -mysql-connector-java = { module = "mysql:mysql-connector-java", version.ref = "mysql" } -junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } -java-driver-core = { module = "com.datastax.oss:java-driver-core", version.ref = "java-driver-core" } -java-driver-query-builder = { module = "com.datastax.oss:java-driver-query-builder", version.ref = "java-driver-query-builder" } +mysql-connector-java = { module = "com.mysql:mysql-connector-j", version.ref = "mysql" } +cassandra-driver-core = { module = "org.apache.cassandra:java-driver-core", version.ref = "cassandra-driver" } +cassandra-query-builder = { module = "org.apache.cassandra:java-driver-query-builder", version.ref = "cassandra-driver" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson-databind" } jts-core = { module = "org.locationtech.jts:jts-core", version.ref = "jts-core" } -assertk-jvm = { module = "com.willowtreeapps.assertk:assertk-jvm", version.ref = "assertk-jvm" } -spring-jdbc = { module = "org.springframework:spring-jdbc", version.ref = "spring-jdbc" } mongodb-driver = { module = "org.mongodb:mongodb-driver-sync", version.ref = "mongodb-driver" } [bundles] - +cassandra-driver = ["cassandra-driver-core", "cassandra-query-builder"] [plugins] diff --git a/jcv-db-cassandra/build.gradle.kts b/jcv-db-cassandra/build.gradle.kts index 917d2c7..4acd5a2 100644 --- a/jcv-db-cassandra/build.gradle.kts +++ b/jcv-db-cassandra/build.gradle.kts @@ -76,8 +76,7 @@ dependencies { implementation(libs.kotlin.stdlib) implementation(libs.jcv.core) implementation(libs.jsonassert) - implementation(libs.java.driver.core) - implementation(libs.java.driver.query.builder) + implementation(libs.bundles.cassandra.driver) testImplementation(libs.junit) } diff --git a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt index e450e6c..68c92ca 100644 --- a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt +++ b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt @@ -1,8 +1,7 @@ package com.ekino.oss.jcv.db -import assertk.assertThat +import assertk.assertFailure import assertk.assertions.hasMessage -import assertk.assertions.isFailure import com.ekino.oss.jcv.db.model.RowModel import com.ekino.oss.jcv.db.model.TableModel import org.json.JSONArray @@ -102,16 +101,18 @@ class DbComparatorAssertTest { ) ) - assertThat { + assertFailure { DbComparatorAssert.assertThatTableModel(tableModel).isValidAgainst(expected) - }.isFailure().hasMessage( - """[content_test=abcd] -Expected: a JSON object - but none found - ; [content_test=abcde] -Unexpected: a JSON object - -Actual: [{"content_test":"abcde"}]""" + }.hasMessage( + """ + [content_test=abcd] + Expected: a JSON object + but none found + ; [content_test=abcde] + Unexpected: a JSON object + + Actual: [{"content_test":"abcde"}] + """.trimIndent() ) } } diff --git a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt index 5c4a9e6..9f7d143 100644 --- a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt +++ b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt @@ -17,22 +17,27 @@ class ValidatorsTest { @Test fun `json object validator`() { - assertThat { - compare( - """{"field_name": {}}""", - """{"field_name": "{#json_object#}"}""" - ) - }.isSuccess() + assertThat( + runCatching { + compare( + """{"field_name": {}}""", + """{"field_name": "{#json_object#}"}""" + ) + } + ).isSuccess() } @Test fun `json array validator`() { - assertThat { - compare( - """{"field_name": []}""", - """{"field_name": "{#json_array#}"}""" - ) - }.isSuccess() + assertThat( + runCatching { + compare( + """{"field_name": []}""", + """{"field_name": "{#json_array#}"}""" + ) + } + ) + .isSuccess() } @Test @@ -71,7 +76,7 @@ class ValidatorsTest { } } - private fun compare(actualJson: String, expectedJson: String, body: (JSONCompareResult) -> Unit = {}) = body.invoke( + private fun compare(actualJson: String, expectedJson: String, body: (JSONCompareResult) -> Unit = {}) = body( JSONCompare.compareJSON( expectedJson, actualJson, diff --git a/jcv-db-jdbc/build.gradle.kts b/jcv-db-jdbc/build.gradle.kts index 14d26dd..a470032 100644 --- a/jcv-db-jdbc/build.gradle.kts +++ b/jcv-db-jdbc/build.gradle.kts @@ -25,7 +25,6 @@ val javadocJar by tasks.registering(Jar::class) { from(layout.buildDirectory.file("dokka")) } - java { withSourcesJar() } @@ -81,7 +80,6 @@ dependencies { implementation(libs.postgres) implementation(libs.mssql.jdbc) implementation(libs.mysql.connector.java) - implementation(libs.spring.jdbc) implementation(libs.jackson.databind) testImplementation(libs.junit) diff --git a/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt b/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt index b8eaa71..2abe1be 100644 --- a/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt +++ b/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt @@ -17,12 +17,14 @@ class ValidatorsTest { @Test fun `mongo id validator`() { - assertThat { - compare( - """{"field_name": "5d8253faef748a2c0e53ebfd"}""", - """{"field_name": "{#mongo_id#}"}""" - ) - }.isSuccess() + assertThat( + runCatching { + compare( + """{"field_name": "5d8253faef748a2c0e53ebfd"}""", + """{"field_name": "{#mongo_id#}"}""" + ) + } + ).isSuccess() } @Test