invocationSequenceData.setSpanIdent(span.getSpanIdent());
@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)); }
@BeforeMethod public void initMocks() { doAnswer(new Answer<ScheduledFuture<Void>>() { @Override public ScheduledFuture<Void> answer(InvocationOnMock invocation) throws Throwable { ((Runnable) invocation.getArguments()[0]).run(); return null; } }).when(scheduledExecutor).schedule(any(Runnable.class), anyLong(), any()); when(backEndSpan.getPropagationType()).thenReturn(PropagationType.HTTP); when(backEndSpan.isRoot()).thenReturn(true); when(backEndSpan.getSpanIdent()).thenReturn(backEndIdent); when(frontEndSpan.getPropagationType()).thenReturn(PropagationType.HTTP); when(frontEndSpan.isRoot()).thenReturn(true); PageLoadRequest details = mock(PageLoadRequest.class); when(frontEndSpan.getDetails()).thenReturn(details); when(frontEndSpan.getDetails()).thenReturn(spanDetails); when(frontEndSpan.getSpanIdent()).thenReturn(frontEndIdent); }
/** * {@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() + "]"; }