Skip to content

Commit f83207b

Browse files
committed
Modernize JUnit Gradle configuration
1 parent ac7d80d commit f83207b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,16 @@ dependencies {
146146
}
147147

148148
testing {
149-
suites.withType(JvmTestSuite::class).configureEach {
149+
withType<Test>().configureEach {
150+
useJUnitJupiter()
151+
150152
dependencies {
151153
implementation(project(project.path))
152154

153-
implementation(enforcedPlatform("org.junit:junit-bom:5.14.0"))
155+
// this is only needed to establish the version of JUnit we want to use
156+
// since Renovate doesn't currently understand useJUnitJupiter("<version>")
157+
implementation("org.junit.jupiter:junit-jupiter-api:5.14.0")
158+
154159
implementation(enforcedPlatform("org.testcontainers:testcontainers-bom:1.21.3"))
155160
implementation(enforcedPlatform("com.google.guava:guava-bom:33.5.0-jre"))
156161
implementation(enforcedPlatform("com.linecorp.armeria:armeria-bom:1.33.4"))
@@ -159,16 +164,11 @@ testing {
159164
compileOnly("com.google.errorprone:error_prone_annotations")
160165
compileOnly("com.google.code.findbugs:jsr305")
161166

162-
implementation("org.junit.jupiter:junit-jupiter-api")
163-
implementation("org.junit.jupiter:junit-jupiter-params")
164167
implementation("org.mockito:mockito-core")
165168
implementation("org.mockito:mockito-junit-jupiter")
166169
implementation("org.assertj:assertj-core")
167170
implementation("org.awaitility:awaitility")
168171
implementation("io.github.netmikey.logunit:logunit-jul")
169-
170-
runtimeOnly("org.junit.jupiter:junit-jupiter-engine")
171-
runtimeOnly("org.junit.platform:junit-platform-launcher")
172172
}
173173
}
174174
}

0 commit comments

Comments
 (0)