RequestContextCurrentTraceContext extends CurrentTraceContext { @Override @Nullable public TraceContext get() { final RequestContext ctx = getRequestContextOrWarnOnce(); if (ctx == null) { return THREAD_LOCAL_CONTEXT.get(); } if (ctx.eventLoop().inEventLoop()) { return traceContext(ctx); } else { final TraceContext threadLocalContext = THREAD_LOCAL_CONTEXT.get(); if (threadLocalContext != null) { return threadLocalContext; } return traceContext(ctx); } } RequestContextCurrentTraceContext(
            CurrentTraceContext.Builder builder, List<Pattern> nonRequestThreadPatterns); static RequestContextCurrentTraceContext ofDefault(); static RequestContextCurrentTraceContextBuilder builder(); static void setCurrentThreadNotRequestThread(boolean value); @Override @Nullable TraceContext get(); @Override Scope newScope(@Nullable TraceContext currentSpan);  }
@Test public void get_returnsNullWhenNoCurrentRequestContext() { assertThat(currentTraceContext.get()).isNull(); }
@Test public void get_returnsNullWhenCurrentRequestContext_hasNoTraceAttribute() { try (SafeCloseable requestContextScope = ctx.push()) { assertThat(currentTraceContext.get()).isNull(); } }