[*] Fix testing setup

This commit is contained in:
2025-03-01 10:05:49 +01:00
parent b466ccd577
commit 0eac7e42aa
2 changed files with 12 additions and 5 deletions

View File

@@ -17,10 +17,10 @@ repositories {
mavenCentral()
}
sourceSets {
test {
runtimeClasspath = main.get().runtimeClasspath
}
val testAgent = configurations.dependencyScope("mockitoAgent")
val testAgentClasspath = configurations.resolvable("testAgentClasspath") {
isTransitive = false
extendsFrom(testAgent.get())
}
dependencies {
@@ -38,16 +38,22 @@ dependencies {
implementation(libs.slf4j.api)
"localRuntimeOnly"(libs.slf4j.rt)
testRuntimeOnly(libs.slf4j.rt)
testImplementation(platform(libs.junit.platform))
testImplementation(libs.junit.core)
testRuntimeOnly(libs.junit.launcher)
testImplementation(libs.mockito)
testAgent(libs.mockito)
testImplementation(libs.assertj)
}
tasks.test {
dependsOn(testAgentClasspath)
useJUnitPlatform()
jvmArgs(testAgentClasspath.get().files.map { file -> "-javaagent:${file.absolutePath}" })
systemProperties(
"junit.jupiter.execution.timeout.mode" to "disabled_on_debug",
"junit.jupiter.execution.timeout.testable.method.default" to "10s",

View File

@@ -4,7 +4,7 @@ asm = "9.7"
autoservice = "1.1.1"
java = "8"
jetbrains-annotations = "26.0.1"
junit = "5.11.2"
junit = "5.12.0"
lombok = "1.18.34"
mockito = "5.14.2"
slf4j = "2.0.16"
@@ -18,6 +18,7 @@ autoservice-processor = { group = "com.google.auto.service", name = "auto-servic
jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrains-annotations" }
junit-platform = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
junit-core = { group = "org.junit.jupiter", name = "junit-jupiter" }
junit-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok" }
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }