Skip to content

Commit a67e7cd

Browse files
authored
Modernize/simplify JUnit Gradle configuration (#359)
Use useJUnitJupiter() which automatically adds the necessary JUnit dependencies, removing the need to explicitly declare junit-bom, junit-jupiter-api, junit-jupiter-params, junit-jupiter-engine, and junit-platform-launcher.
1 parent f98e769 commit a67e7cd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,12 @@ dependencies {
131131

132132
testing {
133133
suites.withType(JvmTestSuite::class).configureEach {
134+
useJUnitJupiter("5.14.0")
135+
134136
dependencies {
135137
implementation(project(project.path))
136-
implementation(enforcedPlatform("org.junit:junit-bom:5.14.1"))
137-
implementation(enforcedPlatform("org.assertj:assertj-bom:3.27.6"))
138138

139-
implementation("org.junit.jupiter:junit-jupiter-api")
140-
implementation("org.junit.jupiter:junit-jupiter-params")
141-
runtimeOnly("org.junit.jupiter:junit-jupiter-engine")
142-
runtimeOnly("org.junit.platform:junit-platform-launcher")
139+
implementation(enforcedPlatform("org.assertj:assertj-bom:3.27.6"))
143140

144141
implementation("org.assertj:assertj-core")
145142
}

0 commit comments

Comments
 (0)