@Test public void SpanAroundAsyncCallFinisher_finishCallSpan_does_nothing_if_spanAroundCallTracingState_is_null() { // given SpanAroundAsyncCallFinisher finisherSpy = spy(new SpanAroundAsyncCallFinisher( null, requestMock, tagAndNamingStrategy, tagAndNamingAdapterMock )); ClientHttpResponse responseMock = mock(ClientHttpResponse.class); Throwable errorMock = mock(Throwable.class); // when finisherSpy.finishCallSpan(responseMock, errorMock); // then verify(finisherSpy).finishCallSpan(responseMock, errorMock); verifyNoMoreInteractions(finisherSpy); verifyZeroInteractions(responseMock, errorMock); } }
subspanFinisher = new SpanAroundAsyncCallFinisher( TracingState.getCurrentThreadTracingState(), wrapperRequest, tagAndNamingStrategy, tagAndNamingAdapter ); subspanFinisher.finishCallSpan(null, t);
subspanFinisher = new SpanAroundAsyncCallFinisher( TracingState.getCurrentThreadTracingState(), wrapperRequest, tagAndNamingStrategy, tagAndNamingAdapter ); subspanFinisher.finishCallSpan(null, t);
@Override public void onFailure(Throwable ex) { finishCallSpan(null, ex); }
@Override public void onSuccess(ClientHttpResponse result) { finishCallSpan(result, null); }
@Override public void onFailure(Throwable ex) { finishCallSpan(null, ex); }
@Override public void onSuccess(ClientHttpResponse result) { finishCallSpan(result, null); }