OpenTracingHttpTagStrategy extends HttpTagAndSpanNamingStrategy<REQ, RES> { @Override protected void doHandleRequestTagging( @NotNull Span span, @NotNull REQ request, @NotNull HttpTagAndSpanNamingAdapter<REQ, ?> adapter ) { putTagIfValueIsNotBlank(span, KnownOpenTracingTags.HTTP_METHOD, adapter.getRequestHttpMethod(request)); putTagIfValueIsNotBlank(span, KnownOpenTracingTags.HTTP_URL, adapter.getRequestUrl(request)); }  @SuppressWarnings("unchecked") static OpenTracingHttpTagStrategy<REQ, RES> getDefaultInstance();  }
@Test public void doHandleRequestTagging_puts_expected_tags_based_on_adapter_results() { String adapterHttpMethod = "httpmethod-" + UUID.randomUUID().toString(); String adapterHttpUrl = "url-" + UUID.randomUUID().toString(); doReturn(adapterHttpMethod).when(adapterMock).getRequestHttpMethod(anyObject()); doReturn(adapterHttpUrl).when(adapterMock).getRequestUrl(anyObject()); implSpy.doHandleRequestTagging(spanMock, requestMock, adapterMock); verify(adapterMock).getRequestHttpMethod(requestMock); verify(adapterMock).getRequestUrl(requestMock); verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownOpenTracingTags.HTTP_METHOD, adapterHttpMethod); verify(implSpy).putTagIfValueIsNotBlank(spanMock, KnownOpenTracingTags.HTTP_URL, adapterHttpUrl); }