Skip to content

Commit ef895bc

Browse files
authored
test: try using Kotlin to write test code. (#715)
1 parent 268b133 commit ef895bc

File tree

3 files changed

+182
-362
lines changed

3 files changed

+182
-362
lines changed

build.gradle.kts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ plugins {
88
id("com.github.ben-manes.versions") version "0.51.0"
99
id("io.freefair.lombok") version "8.10.2"
1010
id("com.gradleup.nmcp") version "0.0.9"
11+
kotlin("jvm") version "2.2.0"
1112
}
1213

1314
group = "network.lightsail"
1415
version = "2.0.0-beta0"
1516

1617
java {
17-
sourceCompatibility = JavaVersion.VERSION_1_8
18-
targetCompatibility = JavaVersion.VERSION_1_8
18+
toolchain {
19+
languageVersion = JavaLanguageVersion.of(8)
20+
}
21+
}
22+
23+
kotlin {
24+
jvmToolchain(8)
1925
}
2026

2127
spotless {
@@ -24,6 +30,10 @@ spotless {
2430
removeUnusedImports()
2531
googleJavaFormat()
2632
}
33+
kotlin {
34+
target("src/test/kotlin/**/*.kt")
35+
ktfmt("0.56").googleStyle()
36+
}
2737
}
2838

2939
repositories {
@@ -46,6 +56,9 @@ dependencies {
4656
testImplementation("org.bouncycastle:bcpkix-jdk18on:1.79") // mock https
4757
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.11.3")
4858
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
59+
60+
testImplementation("io.kotest:kotest-runner-junit5:5.9.1")
61+
testImplementation("io.kotest:kotest-assertions-core:5.9.1")
4962
}
5063

5164
tasks {
@@ -197,4 +210,4 @@ nmcp {
197210
// or if you want to publish automatically
198211
// publicationType = "AUTOMATIC"
199212
}
200-
}
213+
}

0 commit comments

Comments
 (0)