@Test public void context() { when(spanImpl.context()).thenReturn(new SpanContextImpl(1, 2, 3, null, Collections.<String, String> emptyMap())); AbstractSpan span = SpanTransformer.transformSpan(spanImpl); SpanIdent spanIdent = span.getSpanIdent(); assertThat(spanIdent.getId(), is(1L)); assertThat(spanIdent.getTraceId(), is(2L)); assertThat(span.getParentSpanId(), is(3L)); }
@Test public void transformerInterface() { when(spanImpl.context()).thenReturn(new SpanContextImpl(1, 2, 3, null, Collections.<String, String> emptyMap())); AbstractSpan span = SpanTransformer.INSTANCE.transform(spanImpl); SpanIdent spanIdent = span.getSpanIdent(); assertThat(spanIdent.getId(), is(1L)); assertThat(spanIdent.getTraceId(), is(2L)); assertThat(span.getParentSpanId(), is(3L)); }
/** * {@inheritDoc} */ @Override public String toString() { return "AbstractSpan [isCaller()=" + this.isCaller() + ", getSpanIdent()=" + this.getSpanIdent() + ", getDuration()=" + this.getDuration() + ", getPropagationType()=" + this.getPropagationType() + ", getReferenceType()=" + this.getReferenceType() + ", getParentSpanId()=" + this.getParentSpanId() + ", isRoot()=" + this.isRoot() + ", getTags()=" + this.getTags() + "]"; }