use of io.opencensus.trace.EndSpanOptions in project instrumentation-java by census-instrumentation.
the class HttpClientHandlerTest method handleEndShouldEndSpan.
@Test
public void handleEndShouldEndSpan() {
HttpRequestContext context = new HttpRequestContext(parentSpan, tagContext);
when(extractor.getStatusCode(any(Object.class))).thenReturn(0);
handler.handleEnd(context, request, response, null);
verify(parentSpan).end(optionsCaptor.capture());
EndSpanOptions options = optionsCaptor.getValue();
assertThat(options).isEqualTo(EndSpanOptions.DEFAULT);
}
use of io.opencensus.trace.EndSpanOptions in project instrumentation-java by census-instrumentation.
the class HttpServerHandlerTest method handleEndShouldEndSpan.
@Test
public void handleEndShouldEndSpan() {
HttpRequestContext context = new HttpRequestContext(spanWithLocalParent, tagContext);
when(extractor.getStatusCode(any(Object.class))).thenReturn(0);
handler.handleEnd(context, carrier, response, null);
verify(spanWithLocalParent).end(optionsCaptor.capture());
EndSpanOptions options = optionsCaptor.getValue();
assertThat(options).isEqualTo(EndSpanOptions.DEFAULT);
}
Aggregations