Skip to content

Commit 4f0779d

Browse files
committed
Fix HooksTest compile: access RunnableWrapper via package-private + reflection for resetOnScheduleHook
1 parent 1669bc4 commit 4f0779d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

instrumentation/reactor/reactor-3.1/library/src/main/java/io/opentelemetry/instrumentation/reactor/v3_1/ContextPropagationOperator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public Object scanUnsafe(Scannable.Attr attr) {
388388
}
389389
}
390390

391-
private static class RunnableWrapper implements Runnable {
391+
static class RunnableWrapper implements Runnable {
392392
private final Runnable delegate;
393393
private final Context context;
394394

instrumentation/reactor/reactor-3.1/library/src/test/java/io/opentelemetry/instrumentation/reactor/v3_1/HooksTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ class HooksTest {
4040
TraceState.getDefault()));
4141

4242
@AfterEach
43-
void resetHooks() {
43+
void resetHooks() throws ReflectiveOperationException {
4444
Hooks.resetOnEachOperator(TracingSubscriber.class.getName());
4545
if (schedulerHooksSupported()) {
46-
Schedulers.resetOnScheduleHook(RunnableWrapper.class.getName());
46+
Schedulers.class
47+
.getMethod("resetOnScheduleHook", String.class)
48+
.invoke(null, ContextPropagationOperator.RunnableWrapper.class.getName());
4749
}
4850
}
4951

0 commit comments

Comments
 (0)