use of com.github.kristofa.brave.TraceData in project jaeger-client-java by jaegertracing.
the class B3TextMapCodecTest method testInject_unsampled.
@Test
public void testInject_unsampled() throws Exception {
DelegatingTextMap textMap = new DelegatingTextMap();
b3Codec.inject(new SpanContext(1, 1, 0, (byte) 0), textMap);
TraceData data = takeRequestFromTextMap(textMap);
assertEquals(Boolean.FALSE, data.getSample());
}
use of com.github.kristofa.brave.TraceData in project jaeger-client-java by jaegertracing.
the class B3TextMapCodecTest method testInject_rootSpan.
@Test
public void testInject_rootSpan() throws Exception {
DelegatingTextMap textMap = new DelegatingTextMap();
b3Codec.inject(new SpanContext(1, 1, 0, SAMPLED), textMap);
TraceData data = takeRequestFromTextMap(textMap);
assertEquals(1, data.getSpanId().traceId);
assertEquals(null, data.getSpanId().nullableParentId());
assertEquals(1, data.getSpanId().spanId);
assertEquals(Boolean.TRUE, data.getSample());
}
use of com.github.kristofa.brave.TraceData in project jaeger-client-java by jaegertracing.
the class B3TextMapCodecTest method testInject_childSpan.
@Test
public void testInject_childSpan() throws Exception {
DelegatingTextMap textMap = new DelegatingTextMap();
b3Codec.inject(new SpanContext(1, 2, 1, SAMPLED), textMap);
TraceData data = takeRequestFromTextMap(textMap);
assertEquals(1, data.getSpanId().traceId);
assertEquals(Long.valueOf(1), data.getSpanId().nullableParentId());
assertEquals(2, data.getSpanId().spanId);
assertEquals(Boolean.TRUE, data.getSample());
}
Aggregations