Search in sources :

Example 1 with ServerRequestCarrier

use of com.uber.jaeger.filters.jaxrs2.ServerRequestCarrier in project jaeger-client-java by jaegertracing.

the class FilterIntegrationTest method testExtractorReturnsNullWhenTracerStateHeaderIsMissing.

/*
   * This test exists because opentracing's convention around missing tracer
   * state headers may change to stop supporting the automatic creation of
   * building a span.
   */
@Test
public void testExtractorReturnsNullWhenTracerStateHeaderIsMissing() {
    ContainerRequestContext reqContext = mock(ContainerRequestContext.class);
    given(reqContext.getHeaders()).willReturn(new MultivaluedHashMap<String, String>());
    ServerRequestCarrier carrier = new ServerRequestCarrier(reqContext);
    SpanContext spanCtx = tracer.extract(Format.Builtin.HTTP_HEADERS, carrier);
    assertNull(spanCtx);
}
Also used : SpanContext(io.opentracing.SpanContext) ContainerRequestContext(javax.ws.rs.container.ContainerRequestContext) ServerRequestCarrier(com.uber.jaeger.filters.jaxrs2.ServerRequestCarrier) Test(org.junit.Test)

Aggregations

ServerRequestCarrier (com.uber.jaeger.filters.jaxrs2.ServerRequestCarrier)1 SpanContext (io.opentracing.SpanContext)1 ContainerRequestContext (javax.ws.rs.container.ContainerRequestContext)1 Test (org.junit.Test)1