HttpTags { public static Tag<HttpRequest> requestHeader(String headerName) { return requestHeader(headerName, headerName); } HttpTags(); static Tag<HttpRequest> requestHeader(String headerName); static Tag<HttpRequest> requestHeader(String key, String headerName); static final Tag<HttpRequest> METHOD; static final Tag<HttpRequest> PATH; static final Tag<HttpRequest> ROUTE; static final Tag<HttpRequest> URL; static final Tag<HttpResponse> STATUS_CODE; }
@Test public void requestHeader() { when(request.header("User-Agent")).thenReturn("Mozilla/5.0"); HttpTags.requestHeader("User-Agent").tag(request, span); verify(span).tag("User-Agent", "Mozilla/5.0"); }
@Test public void requestHeader_renamed() { when(request.header("User-Agent")).thenReturn("Mozilla/5.0"); HttpTags.requestHeader("http.user_agent", "User-Agent").tag(request, span); verify(span).tag("http.user_agent", "Mozilla/5.0"); }
@Test public void requestHeader_null() { HttpTags.requestHeader("User-Agent").tag(request, span); verifyNoMoreInteractions(span); }