Added test for tags

This commit is contained in:
Marcin Grzejszczak
2016-03-29 10:46:32 +02:00
parent e1cbc374c1
commit 5be6ebf671

View File

@@ -95,4 +95,18 @@ public class SpanTest {
then(deserialized.logs())
.isEqualTo(span.logs());
}
@Test public void should_properly_serialize_tags() throws IOException {
Span span = new Span(1, 2, "http:name", 1L,
Collections.<Long>emptyList(), 2L, true, true, "process");
span.tag("calculatedTax", "100");
ObjectMapper objectMapper = new ObjectMapper();
String serialized = objectMapper.writeValueAsString(span);
Span deserialized = objectMapper.readValue(serialized, Span.class);
then(deserialized.tags())
.isEqualTo(span.tags());
}
}