Search in sources :

Example 1 with EndSpanOptions

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);
}
Also used : EndSpanOptions(io.opencensus.trace.EndSpanOptions) Test(org.junit.Test)

Example 2 with EndSpanOptions

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);
}
Also used : EndSpanOptions(io.opencensus.trace.EndSpanOptions) Test(org.junit.Test)

Aggregations

EndSpanOptions (io.opencensus.trace.EndSpanOptions)2 Test (org.junit.Test)2