HttpServletRequestWrapper extends HttpServerRequest { @Override public String url() { StringBuffer url = delegate.getRequestURL(); if (delegate.getQueryString() != null && !delegate.getQueryString().isEmpty()) { url.append('?').append(delegate.getQueryString()); } return url.toString(); } HttpServletRequestWrapper(HttpServletRequest delegate); static HttpServerRequest create(HttpServletRequest request); @Override final Object unwrap(); @Override boolean parseClientIpAndPort(Span span); @Override final String method(); @Override String route(); @Override final String path(); @Override String url(); @Override final String header(String name);  }
@Test public void url_derivedFromUrlAndQueryString() { when(request.getRequestURL()).thenReturn(new StringBuffer("http: when(request.getQueryString()).thenReturn("hello=world"); assertThat(wrapper.url()) .isEqualTo("http: }