use of io.opencensus.tags.TagContext in project instrumentation-java by census-instrumentation.
the class TagMapImplTest method remove_differentKey.
@Test
public void remove_differentKey() {
TagContext tags = new TagMapImpl(ImmutableMap.of(K1, VM1));
assertThat(((TagMapImpl) tagger.toBuilder(tags).remove(K2).build()).getTags()).containsExactly(K1, VM1);
}
use of io.opencensus.tags.TagContext in project instrumentation-java by census-instrumentation.
the class TagMapImplTest method put_nullKey.
@Test
public void put_nullKey() {
TagContext tags = new TagMapImpl(ImmutableMap.of(K1, VM1));
TagContextBuilder builder = tagger.toBuilder(tags);
thrown.expect(NullPointerException.class);
thrown.expectMessage("key");
builder.put(null, V2);
}
use of io.opencensus.tags.TagContext in project instrumentation-java by census-instrumentation.
the class TagMapImplTest method remove_nullKey.
@Test
public void remove_nullKey() {
TagContext tags = new TagMapImpl(ImmutableMap.of(K1, VM1));
TagContextBuilder builder = tagger.toBuilder(tags);
thrown.expect(NullPointerException.class);
thrown.expectMessage("key");
builder.remove(null);
}
use of io.opencensus.tags.TagContext in project instrumentation-java by census-instrumentation.
the class TagMapImplTest method putLocal.
@Test
public void putLocal() {
TagContext tags1 = tagger.emptyBuilder().put(K1, V1, METADATA_NO_PROPAGATION).build();
TagContext tags2 = tagger.emptyBuilder().putLocal(K1, V1).build();
assertThat(tags1).isEqualTo(tags2);
}
use of io.opencensus.tags.TagContext in project instrumentation-java by census-instrumentation.
the class TagMapImplTest method put_newKey.
@Test
public void put_newKey() {
TagContext tags = new TagMapImpl(ImmutableMap.of(K1, VM1));
assertThat(((TagMapImpl) tagger.toBuilder(tags).put(K2, V2).build()).getTags()).containsExactly(K1, VM1, K2, VM2);
}
Aggregations