@Test
public void testImplicitParentSpan() {

  OpencensusTracerFactory factory =
      new OpencensusTracerFactory(internalTracer, defaultSpanAttributes);
  Span parentSpan = mock(Span.class);
  Context origContext = ContextUtils.withValue(Context.current(), parentSpan).attach();
  try {
    factory.newTracer(
        NoopApiTracer.getInstance(),
        SpanName.of("FakeClient", "FakeMethod"),
        OperationType.Unary);
  } finally {
    Context.current().detach(origContext);
  }
  verify(internalTracer).spanBuilderWithExplicitParent(anyString(), same(parentSpan));
}