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