Skip to content

Commit

Permalink
Fix sporadic problems in test due to misaligned JUnit version
Browse files Browse the repository at this point in the history
Sometimes the tests fail due to AbstractMethod errors. The cause
seems to be the use of JUnit params in a given version and using
JUnit platform in another. This change:
* alignes JUnit version through the use of a platform declaration
* lets individual package version be aligned through the platform
  • Loading branch information
fwendland committed May 10, 2024
1 parent 612e80d commit 30a24c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ dependencies {

// Unit tests
testImplementation(kotlin("test"))
testImplementation(libs.junit.params)
testImplementation(platform(libs.junit.bom)) // ensure aligned JUnit artifact version
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kotlin-scripting-dependencies = { module = "org.jetbrains.kotlin:kotlin-scriptin
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt"}

# test
junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version = "5.10.2"}
junit-bom = { module = "org.junit:junit-bom", version = "5.10.2" }
mockk = { module = "io.mockk:mockk", version = "1.13.10"}

# this is necessary for the plugins to be used in the buildSrc folder
Expand Down

0 comments on commit 30a24c6

Please sign in to comment.