HttpServerAdapter extends HttpAdapter<Req, Resp> { public boolean parseClientIpAndPort(Req req, Span span) { return parseClientIpFromXForwardedFor(req, span); }  @Deprecated boolean parseClientAddress(Req req, zipkin2.Endpoint.Builder builder); boolean parseClientIpAndPort(Req req, Span span); boolean parseClientIpFromXForwardedFor(Req req, Span span);  }
@Test public void parseClientIpAndPort_prefersXForwardedFor() { when(adapter.requestHeader(request, "X-Forwarded-For")).thenReturn("1.2.3.4"); adapter.parseClientIpAndPort(request, span); verify(span).remoteIpAndPort("1.2.3.4", 0); verifyNoMoreInteractions(span); }
@Test public void parseClientIpAndPort_skipsOnNoIp() { adapter.parseClientIpAndPort(request, span); verifyNoMoreInteractions(span); }