Skip to content

Commit 2d6d310

Browse files
fix(deps): update junit5 monorepo to v5.13.0 (minor) (open-telemetry#13959)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 760d759 commit 2d6d310

File tree

15 files changed

+143
-45
lines changed

15 files changed

+143
-45
lines changed

benchmark-overhead/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repositories {
1616
}
1717

1818
dependencies {
19-
implementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
19+
implementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
2020

2121
testImplementation("org.testcontainers:testcontainers:1.21.1")
2222
testImplementation("org.testcontainers:postgresql:1.21.1")

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dependencies {
7171
implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.2.0")
7272
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.6")
7373

74-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
74+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
7575
testImplementation("org.junit.jupiter:junit-jupiter-api")
7676
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
7777
testImplementation("org.assertj:assertj-core:3.27.3")

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ val CORE_DEPENDENCIES = listOf(
8181
// There are dependencies included here that appear to have no usages, but are maintained at
8282
// this top level to help consistently satisfy large numbers of transitive dependencies.
8383
val DEPENDENCIES = listOf(
84-
"org.junit.jupiter:junit-jupiter-api:5.12.2",
84+
"org.junit.jupiter:junit-jupiter-api:5.13.0",
8585
"org.spockframework:spock-core:2.4-M6-groovy-4.0",
8686
"org.spockframework:spock-junit4:2.4-M6-groovy-4.0",
8787

examples/distro/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ subprojects {
6969

7070
testImplementation("org.mockito:mockito-core:5.18.0")
7171

72-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
72+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
7373
testImplementation("org.junit.jupiter:junit-jupiter-api")
7474
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
7575
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ dependencies {
104104
testImplementation("io.opentelemetry:opentelemetry-api")
105105
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.7.0-alpha")
106106

107-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
107+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
108108
testImplementation("org.junit.jupiter:junit-jupiter-api")
109109
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
110110
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

gradle-plugins/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies {
4444

4545
testImplementation("org.assertj:assertj-core:3.27.3")
4646

47-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
47+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
4848
testImplementation("org.junit.jupiter:junit-jupiter-api")
4949
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
5050
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/semconv/http/ValidRequestMethodsProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import org.junit.jupiter.api.extension.ExtensionContext;
1111
import org.junit.jupiter.params.provider.Arguments;
1212
import org.junit.jupiter.params.provider.ArgumentsProvider;
13+
import org.junit.jupiter.params.support.ParameterDeclarations;
1314

1415
final class ValidRequestMethodsProvider implements ArgumentsProvider {
1516

1617
@Override
17-
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
18+
public Stream<? extends Arguments> provideArguments(
19+
ParameterDeclarations parameters, ExtensionContext context) {
1820
return HttpConstants.KNOWN_METHODS.stream().map(Arguments::of);
1921
}
2022
}

instrumentation-docs/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies {
1212
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.19.0")
1313
implementation("io.opentelemetry:opentelemetry-sdk-common")
1414

15-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.2"))
15+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
1616
testImplementation("org.assertj:assertj-core:3.27.3")
1717
testImplementation("org.junit.jupiter:junit-jupiter-api")
1818
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutinesInstrumentationTest.kt

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ import org.junit.jupiter.api.AfterAll
4646
import org.junit.jupiter.api.Assumptions
4747
import org.junit.jupiter.api.Test
4848
import org.junit.jupiter.api.TestInstance
49-
import org.junit.jupiter.api.extension.ExtensionContext
5049
import org.junit.jupiter.api.extension.RegisterExtension
5150
import org.junit.jupiter.params.ParameterizedTest
5251
import org.junit.jupiter.params.provider.Arguments
5352
import org.junit.jupiter.params.provider.Arguments.arguments
54-
import org.junit.jupiter.params.provider.ArgumentsProvider
55-
import org.junit.jupiter.params.provider.ArgumentsSource
53+
import org.junit.jupiter.params.provider.MethodSource
5654
import java.util.concurrent.Executors
5755
import java.util.concurrent.TimeUnit
5856
import java.util.function.Consumer
@@ -83,7 +81,7 @@ class KotlinCoroutinesInstrumentationTest {
8381
val tracer = testing.openTelemetry.getTracer("test")
8482

8583
@ParameterizedTest
86-
@ArgumentsSource(DispatchersSource::class)
84+
@MethodSource("dispatchersSourceArguments")
8785
fun `cancellation prevents trace`(dispatcher: DispatcherWrapper) {
8886
runCatching {
8987
runTest(dispatcher) {
@@ -116,7 +114,7 @@ class KotlinCoroutinesInstrumentationTest {
116114
}
117115

118116
@ParameterizedTest
119-
@ArgumentsSource(DispatchersSource::class)
117+
@MethodSource("dispatchersSourceArguments")
120118
fun `propagates across nested jobs`(dispatcher: DispatcherWrapper) {
121119
runTest(dispatcher) {
122120
val goodDeferred = async { 1 }
@@ -310,7 +308,7 @@ class KotlinCoroutinesInstrumentationTest {
310308
}
311309

312310
@ParameterizedTest
313-
@ArgumentsSource(DispatchersSource::class)
311+
@MethodSource("dispatchersSourceArguments")
314312
fun `traced mono`(dispatcherWrapper: DispatcherWrapper) {
315313
runTest(dispatcherWrapper) {
316314
mono(dispatcherWrapper.dispatcher) {
@@ -337,7 +335,7 @@ class KotlinCoroutinesInstrumentationTest {
337335
private val animalKey: ContextKey<String> = ContextKey.named("animal")
338336

339337
@ParameterizedTest
340-
@ArgumentsSource(DispatchersSource::class)
338+
@MethodSource("dispatchersSourceArguments")
341339
fun `context contains expected value`(dispatcher: DispatcherWrapper) {
342340
runTest(dispatcher) {
343341
val context1 = Context.current().with(animalKey, "cat")
@@ -512,18 +510,16 @@ class KotlinCoroutinesInstrumentationTest {
512510
span.end()
513511
}
514512

515-
class DispatchersSource : ArgumentsProvider {
516-
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> = Stream.of(
517-
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
518-
// Closeable arguments with no way to avoid it.
519-
arguments(DispatcherWrapper(Dispatchers.Default)),
520-
arguments(DispatcherWrapper(Dispatchers.IO)),
521-
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
522-
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
523-
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
524-
arguments(DispatcherWrapper(vertx.dispatcher()))
525-
)
526-
}
513+
private fun dispatchersSourceArguments(): Stream<Arguments> = Stream.of(
514+
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
515+
// Closeable arguments with no way to avoid it.
516+
arguments(DispatcherWrapper(Dispatchers.Default)),
517+
arguments(DispatcherWrapper(Dispatchers.IO)),
518+
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
519+
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
520+
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
521+
arguments(DispatcherWrapper(vertx.dispatcher()))
522+
)
527523

528524
class DispatcherWrapper(val dispatcher: CoroutineDispatcher) {
529525
override fun toString(): String = dispatcher.toString()
@@ -566,7 +562,7 @@ class KotlinCoroutinesInstrumentationTest {
566562
// regression test for
567563
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/11411
568564
@ParameterizedTest
569-
@ArgumentsSource(DispatchersSource::class)
565+
@MethodSource("dispatchersSourceArguments")
570566
fun `dispatch does not propagate context`(dispatcher: DispatcherWrapper) {
571567
Assumptions.assumeTrue(dispatcher.dispatcher != Dispatchers.Unconfined)
572568

instrumentation/kotlinx-coroutines/kotlinx-coroutines-flow-1.3/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutines13InstrumentationTest.kt

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ import kotlinx.coroutines.runBlocking
2727
import kotlinx.coroutines.withContext
2828
import org.junit.jupiter.api.AfterAll
2929
import org.junit.jupiter.api.TestInstance
30-
import org.junit.jupiter.api.extension.ExtensionContext
3130
import org.junit.jupiter.api.extension.RegisterExtension
3231
import org.junit.jupiter.params.ParameterizedTest
3332
import org.junit.jupiter.params.provider.Arguments
3433
import org.junit.jupiter.params.provider.Arguments.arguments
35-
import org.junit.jupiter.params.provider.ArgumentsProvider
36-
import org.junit.jupiter.params.provider.ArgumentsSource
34+
import org.junit.jupiter.params.provider.MethodSource
3735
import java.util.concurrent.Executors
3836
import java.util.stream.Stream
3937

@@ -58,7 +56,7 @@ class KotlinCoroutines13InstrumentationTest {
5856
val tracer = testing.openTelemetry.getTracer("test")
5957

6058
@ParameterizedTest
61-
@ArgumentsSource(DispatchersSource::class)
59+
@MethodSource("dispatchersSourceArguments")
6260
fun `traced across channels`(dispatcher: DispatcherWrapper) {
6361
runTest(dispatcher) {
6462
val producer = produce {
@@ -110,7 +108,7 @@ class KotlinCoroutines13InstrumentationTest {
110108
}
111109

112110
@ParameterizedTest
113-
@ArgumentsSource(DispatchersSource::class)
111+
@MethodSource("dispatchersSourceArguments")
114112
fun `traced mono with context propagation operator`(dispatcherWrapper: DispatcherWrapper) {
115113
runTest(dispatcherWrapper) {
116114
val currentContext = Context.current()
@@ -145,7 +143,7 @@ class KotlinCoroutines13InstrumentationTest {
145143
}
146144

147145
@ParameterizedTest
148-
@ArgumentsSource(DispatchersSource::class)
146+
@MethodSource("dispatchersSourceArguments")
149147
fun `traced flux`(dispatcherWrapper: DispatcherWrapper) {
150148
runTest(dispatcherWrapper) {
151149
flux(dispatcherWrapper.dispatcher) {
@@ -198,17 +196,15 @@ class KotlinCoroutines13InstrumentationTest {
198196
}
199197
}
200198

201-
class DispatchersSource : ArgumentsProvider {
202-
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> = Stream.of(
203-
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
204-
// Closeable arguments with no way to avoid it.
205-
arguments(DispatcherWrapper(Dispatchers.Default)),
206-
arguments(DispatcherWrapper(Dispatchers.IO)),
207-
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
208-
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
209-
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
210-
)
211-
}
199+
private fun dispatchersSourceArguments(): Stream<Arguments> = Stream.of(
200+
// Wrap dispatchers since it seems that ParameterizedTest tries to automatically close
201+
// Closeable arguments with no way to avoid it.
202+
arguments(DispatcherWrapper(Dispatchers.Default)),
203+
arguments(DispatcherWrapper(Dispatchers.IO)),
204+
arguments(DispatcherWrapper(Dispatchers.Unconfined)),
205+
arguments(DispatcherWrapper(threadPool.asCoroutineDispatcher())),
206+
arguments(DispatcherWrapper(singleThread.asCoroutineDispatcher())),
207+
)
212208

213209
class DispatcherWrapper(val dispatcher: CoroutineDispatcher) {
214210
override fun toString(): String = dispatcher.toString()

0 commit comments

Comments
 (0)