From d00e3ed265d79e873941a7aada9afc55dc5dbfd9 Mon Sep 17 00:00:00 2001 From: Jun Luo <4catcode@gmail.com> Date: Tue, 21 Apr 2026 11:07:23 +0800 Subject: [PATCH] chore: upgrade kotest to 6.1.11 and freefair.lombok to 9.4.0 --- build.gradle.kts | 7 +++---- src/test/kotlin/org/stellar/sdk/KeyPairTest.kt | 18 +++++++++--------- src/test/kotlin/org/stellar/sdk/PriceTest.kt | 4 ++-- src/test/kotlin/org/stellar/sdk/StrKeyTest.kt | 18 +++++++++--------- src/test/kotlin/org/stellar/sdk/TOIDTest.kt | 4 ++-- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 91412af2b..cf05c4851 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("project-report") id("com.diffplug.spotless") version "8.4.0" id("com.github.ben-manes.versions") version "0.54.0" - id("io.freefair.lombok") version "9.2.0" + id("io.freefair.lombok") version "9.4.0" id("com.gradleup.nmcp").version("1.4.4") kotlin("jvm") version "2.3.20" } @@ -60,9 +60,8 @@ dependencies { testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.11.3") testRuntimeOnly("org.junit.platform:junit-platform-launcher") - testImplementation("io.kotest:kotest-runner-junit5:5.9.1") - testImplementation("io.kotest:kotest-assertions-core:5.9.1") - testImplementation("io.kotest:kotest-framework-datatest:5.9.1") + testImplementation("io.kotest:kotest-runner-junit5:6.1.11") + testImplementation("io.kotest:kotest-assertions-core:6.1.11") } tasks { diff --git a/src/test/kotlin/org/stellar/sdk/KeyPairTest.kt b/src/test/kotlin/org/stellar/sdk/KeyPairTest.kt index 71c8aeead..aed4bca31 100644 --- a/src/test/kotlin/org/stellar/sdk/KeyPairTest.kt +++ b/src/test/kotlin/org/stellar/sdk/KeyPairTest.kt @@ -2,7 +2,7 @@ package org.stellar.sdk import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec -import io.kotest.datatest.withData +import io.kotest.datatest.withTests import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import java.util.Base64 @@ -36,7 +36,7 @@ class KeyPairTest : "gsYRSEQhTffqA9opPepAENCr2WG6z5iBHHubxxbRzWaHf8FBWcu", ) - withData( + withTests( nameFn = { "should create keypair from secret seed ${it.first}" }, testKeypairs.toList(), ) { (seed, expectedAccountId) -> @@ -56,11 +56,11 @@ class KeyPairTest : newPair.accountId shouldBe original.accountId } - withData(nameFn = { "should throw for invalid seed: $it" }, invalidSeeds) { invalidSeed -> + withTests(nameFn = { "should throw for invalid seed: $it" }, invalidSeeds) { invalidSeed -> shouldThrow { KeyPair.fromSecretSeed(invalidSeed) } } - withData(nameFn = { "should throw for invalid seed char array: $it" }, invalidSeeds) { + withTests(nameFn = { "should throw for invalid seed char array: $it" }, invalidSeeds) { invalidSeed -> shouldThrow { KeyPair.fromSecretSeed(invalidSeed.toCharArray()) } } @@ -79,7 +79,7 @@ class KeyPairTest : "gsYRSEQhTffqA9opPepAENCr2WG6z5iBHHubxxbRzWaHf8FBWcu", ) - withData(nameFn = { "should create keypair from account ID $it" }, testKeypairs.values) { + withTests(nameFn = { "should create keypair from account ID $it" }, testKeypairs.values) { accountId -> val keypair = KeyPair.fromAccountId(accountId) @@ -87,7 +87,7 @@ class KeyPairTest : keypair.accountId shouldBe accountId } - withData(nameFn = { "should throw for invalid account ID: $it" }, invalidAccountIds) { + withTests(nameFn = { "should throw for invalid account ID: $it" }, invalidAccountIds) { invalidAccountId -> shouldThrow { KeyPair.fromAccountId(invalidAccountId) } } @@ -220,7 +220,7 @@ class KeyPairTest : data class MessageTestCase(val input: List, val expectedSigHex: String) - withData( + withTests( nameFn = { case -> "should sign and verify message: ${case.input}" }, listOf( MessageTestCase( @@ -243,7 +243,7 @@ class KeyPairTest : messageKeypair.verifyMessage(inputAsByteArray, expectedSig) shouldBe true } - withData( + withTests( nameFn = { "should fail message verification with invalid signature: $it" }, listOf( "540d7eee179f370bf634a49c1fa9fe4a58e3d7990b0207be336c04edfcc539ff8bd0c31bb2c0359b07c9651cb2ae104e4504657b5d17d43c69c7e50e23811b0d", @@ -317,7 +317,7 @@ class KeyPairTest : "SBPAJWWJJMPPOY2R726MFC7XHT4WXMJ2YCML6EB46UJZC5SIHCTLETT4", ) - withData( + withTests( nameFn = { (index, account, _) -> "should create keypair from BIP39 seed for account $index: $account" }, diff --git a/src/test/kotlin/org/stellar/sdk/PriceTest.kt b/src/test/kotlin/org/stellar/sdk/PriceTest.kt index f7e5538ad..170eb7b9c 100644 --- a/src/test/kotlin/org/stellar/sdk/PriceTest.kt +++ b/src/test/kotlin/org/stellar/sdk/PriceTest.kt @@ -1,7 +1,7 @@ package org.stellar.sdk import io.kotest.core.spec.style.FunSpec -import io.kotest.datatest.withData +import io.kotest.datatest.withTests import io.kotest.matchers.shouldBe data class PriceTestCase( @@ -13,7 +13,7 @@ data class PriceTestCase( class PriceTest : FunSpec({ context("Price.fromString()") { - withData( + withTests( nameFn = { "should parse '${it.input}' to ${it.expectedNumerator}/${it.expectedDenominator}" }, diff --git a/src/test/kotlin/org/stellar/sdk/StrKeyTest.kt b/src/test/kotlin/org/stellar/sdk/StrKeyTest.kt index 2309b99bc..e8e303c30 100644 --- a/src/test/kotlin/org/stellar/sdk/StrKeyTest.kt +++ b/src/test/kotlin/org/stellar/sdk/StrKeyTest.kt @@ -2,7 +2,7 @@ package org.stellar.sdk import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec -import io.kotest.datatest.withData +import io.kotest.datatest.withTests import io.kotest.matchers.shouldBe class StrKeyTest : @@ -17,7 +17,7 @@ class StrKeyTest : } context("is valid") { - withData( + withTests( nameFn = { "should be true for $it" }, "GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB", "GB7KKHHVYLDIZEKYJPAJUOTBE5E3NJAXPSDZK7O6O44WR3EBRO5HRPVT", @@ -33,7 +33,7 @@ class StrKeyTest : StrKey.isValidEd25519PublicKey(publicKey) shouldBe true } - withData( + withTests( nameFn = { "should be false for $it" }, "GA3D5KRYM6CB7OWOOOORR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQHES5", // corrupted payload "GBPXX0A5N4JYPESHAADMQKBPWZWQDQ64ZV6ZL2S3LAGW4SY7NTCMWIVL", // wrong checksum @@ -63,7 +63,7 @@ class StrKeyTest : } context("should validate valid seeds") { - withData( + withTests( nameFn = { "should be true for $it" }, "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDY", "SCZTUEKSEH2VYZQC6VLOTOM4ZDLMAGV4LUMH4AASZ4ORF27V2X64F2S2", @@ -77,7 +77,7 @@ class StrKeyTest : } context("should reject invalid seeds") { - withData( + withTests( nameFn = { "should be false for $it" }, "GBJCHUKZMTFSLOMNC7P4TS4VJJBTCYL3XKSOLXAUJSD56C4LHND5TWUC", // wrong version "SAB5556L5AN5KSR5WF7UOEFDCIODEWEO7H2UR4S5R62DFTQOGLKOVZDYT", // too long @@ -249,7 +249,7 @@ class StrKeyTest : "PBJCHUKZMTFSLOMNC7P4TS4VJJBTCYL3XKSOLXAUJSD56C4LHND5SAAAAAAQMAAAADDCO" ) shouldBe true } - withData( + withTests( nameFn = { "should be false for $it" }, "PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAQACAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4DUPB6IAAAAAAAAPM", "PA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAOQCAQDAQCQMBYIBEFAWDANBYHRAEISCMKBKFQXDAMRUGY4Z2PQ", @@ -339,7 +339,7 @@ class StrKeyTest : context("should reject all invalid StrKey cases") { // https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0023.md - withData( + withTests( nameFn = { "should throw IllegalArgumentException for $it" }, "GAAAAAAAACGC6", "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUR", @@ -412,7 +412,7 @@ class StrKeyTest : ) context("round trip consistency") { - withData( + withTests( nameFn = { "should handle ${it.description}" }, MuxedAccountTestCase( "ID = 0", @@ -473,7 +473,7 @@ class StrKeyTest : } context("error handling") { - withData( + withTests( nameFn = { "should throw for ${it.first}" }, Pair("too short bytes (39)", 39), Pair("too long bytes (41)", 41), diff --git a/src/test/kotlin/org/stellar/sdk/TOIDTest.kt b/src/test/kotlin/org/stellar/sdk/TOIDTest.kt index 3a5bc3a9a..df2753a27 100644 --- a/src/test/kotlin/org/stellar/sdk/TOIDTest.kt +++ b/src/test/kotlin/org/stellar/sdk/TOIDTest.kt @@ -2,7 +2,7 @@ package org.stellar.sdk import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec -import io.kotest.datatest.withData +import io.kotest.datatest.withTests import io.kotest.matchers.shouldBe class TOIDTest : @@ -12,7 +12,7 @@ class TOIDTest : val opFirst = 1L context("test toInt64 and fromInt64") { - withData( + withTests( nameFn = { (toid, id) -> "TOID(${toid.ledgerSequence}, ${toid.transactionOrder}, ${toid.operationIndex}) should be $id" },