Skip to content

Commit e11f16f

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

2 files changed

Lines changed: 8 additions & 2 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ class HooksTest {
4343
void resetHooks() {
4444
Hooks.resetOnEachOperator(TracingSubscriber.class.getName());
4545
if (schedulerHooksSupported()) {
46-
Schedulers.resetOnScheduleHook(RunnableWrapper.class.getName());
46+
try {
47+
Schedulers.class
48+
.getMethod("resetOnScheduleHook", String.class)
49+
.invoke(null, ContextPropagationOperator.RunnableWrapper.class.getName());
50+
} catch (ReflectiveOperationException e) {
51+
throw new LinkageError(e.getMessage(), e);
52+
}
4753
}
4854
}
4955

0 commit comments

Comments
 (0)