RpcClientHandler extends RpcHandler<RpcClientRequest, RpcClientResponse> { public Span handleSendWithParent(RpcClientRequest request, @Nullable TraceContext parent) { if (request == null) throw new NullPointerException("request == null"); return handleSend(request, tracer.nextSpanWithParent(sampler, request, parent)); } RpcClientHandler(RpcTracing rpcTracing); static RpcClientHandler create(RpcTracing rpcTracing); Span handleSend(RpcClientRequest request); Span handleSendWithParent(RpcClientRequest request, @Nullable TraceContext parent); Span handleSend(RpcClientRequest request, Span span); void handleReceive(RpcClientResponse response, Span span);  }
@Test public void handleSendWithParent_overrideContext() { try (Scope ws = httpTracing.tracing.currentTraceContext().newScope(context)) { brave.Span span = handler.handleSendWithParent(request, null); assertThat(span.context().parentIdAsLong()).isZero(); } }
@Test public void handleSendWithParent_overrideNull() { try (Scope ws = httpTracing.tracing.currentTraceContext().newScope(null)) { brave.Span span = handler.handleSendWithParent(request, context); assertThat(span.context().parentIdAsLong()).isEqualTo(context.spanId()); } }