use of io.opentelemetry.api.baggage.Baggage in project opentelemetry-java by open-telemetry.
the class W3CBaggagePropagatorTest method extract_key_leadingSpaces.
@Test
void extract_key_leadingSpaces() {
W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance();
Context result = propagator.extract(Context.root(), ImmutableMap.of("baggage", " key=value1"), getter);
Baggage expectedBaggage = Baggage.builder().put("key", "value1").build();
assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage);
}
use of io.opentelemetry.api.baggage.Baggage in project opentelemetry-java by open-telemetry.
the class W3CBaggagePropagatorTest method extract_member_single.
@Test
void extract_member_single() {
W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance();
Context result = propagator.extract(Context.root(), ImmutableMap.of("baggage", "key=value"), getter);
Baggage expectedBaggage = Baggage.builder().put("key", "value").build();
assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage);
}
use of io.opentelemetry.api.baggage.Baggage in project opentelemetry-java by open-telemetry.
the class W3CBaggagePropagatorTest method extract_value_multiple_leadingSpaces.
@Test
void extract_value_multiple_leadingSpaces() {
W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance();
Context result = propagator.extract(Context.root(), ImmutableMap.of("baggage", "key= value1,key1=val"), getter);
Baggage expectedBaggage = Baggage.builder().put("key1", "val").put("key", "value1").build();
assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage);
}
use of io.opentelemetry.api.baggage.Baggage in project opentelemetry-java by open-telemetry.
the class W3CBaggagePropagatorTest method extract_value_multiple_empty_withMeEtadata.
@Test
void extract_value_multiple_empty_withMeEtadata() {
W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance();
Context result = propagator.extract(Context.root(), ImmutableMap.of("baggage", "key1=;metakey=metaval,key1=val"), getter);
Baggage expectedBaggage = Baggage.builder().put("key1", "val").build();
assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage);
}
use of io.opentelemetry.api.baggage.Baggage in project opentelemetry-java by open-telemetry.
the class W3CBaggagePropagatorTest method extract_value_multiple_withInnerSpaces.
@Test
void extract_value_multiple_withInnerSpaces() {
W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance();
Context result = propagator.extract(Context.root(), ImmutableMap.of("baggage", "key=valu e1,key1=val"), getter);
Baggage expectedBaggage = Baggage.builder().put("key1", "val").build();
assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage);
}
Aggregations