@Test public void testNullSpanContext() throws NullPointerException { val testChildSpan = noOpsTracer.buildSpan("testOperationName"); SpanContext testNullSpanContext = null; when(tracer.buildSpan("testOperationName")).thenReturn(testChildSpan); val resultSpan = utilUnderTest.startSpan("testOperationName", testNullSpanContext); Assert.assertEquals("testOperationName", resultSpan.getOperationName()); }
public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } @Autowired  Trace(Tracer tracer); }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } @Autowired  Trace(Tracer tracer); Span startSpan(String operationName, SpanContext spnContext); SpanContext extractParentSpan(HttpHeaders headers); }
Trace { public Span startSpan(String operationName, SpanContext spnContext){ Span span; if (spnContext!= null){ span = modelServiceApiTracer.buildSpan(operationName).asChildOf(spnContext).start(); } else { span = modelServiceApiTracer.buildSpan(operationName).start(); } return span; } @Autowired  Trace(Tracer tracer); Span startSpan(String operationName, SpanContext spnContext); SpanContext extractParentSpan(HttpHeaders headers);  }