@Test(expected = ClientException.class) public void testFailedDispatch() throws Exception { final Span span = tracer.buildSpan("sad-path").start(); span.finish(); final ArgumentCaptor<HttpPost> httpPostCapture = ArgumentCaptor.forClass(HttpPost.class); final CloseableHttpClient http = Mockito.mock(CloseableHttpClient.class); final CloseableHttpResponse httpResponse = Mockito.mock(CloseableHttpResponse.class); final BasicStatusLine statusLine = new BasicStatusLine(new ProtocolVersion("v", 1, 1), 404, ""); when(http.execute(httpPostCapture.capture())).thenReturn(httpResponse); when(httpResponse.getStatusLine()).thenReturn(statusLine); final HttpCollectorClient client = new HttpCollectorClient("http: client.send(span); }
@Override public boolean send(Span span) throws ClientException { final byte[] spanBytes = format.format(span).toByteArray(); return super.send(spanBytes); }
HttpCollectorClient extends BaseHttpClient implements Client<Span> { @Override public boolean send(Span span) throws ClientException { final byte[] spanBytes = format.format(span).toByteArray(); return super.send(spanBytes); } }
HttpCollectorClient extends BaseHttpClient implements Client<Span> { @Override public boolean send(Span span) throws ClientException { final byte[] spanBytes = format.format(span).toByteArray(); return super.send(spanBytes); } HttpCollectorClient(String endpoint, Map<String, String> headers);  HttpCollectorClient(String endpoint);  HttpCollectorClient(final String endpoint,
                               final Map<String, String> headers,
                               final CloseableHttpClient httpClient); }
HttpCollectorClient extends BaseHttpClient implements Client<Span> { @Override public boolean send(Span span) throws ClientException { final byte[] spanBytes = format.format(span).toByteArray(); return super.send(spanBytes); } HttpCollectorClient(String endpoint, Map<String, String> headers);  HttpCollectorClient(String endpoint);  HttpCollectorClient(final String endpoint,
                               final Map<String, String> headers,
                               final CloseableHttpClient httpClient); @Override boolean send(Span span); }
HttpCollectorClient extends BaseHttpClient implements Client<Span> { @Override public boolean send(Span span) throws ClientException { final byte[] spanBytes = format.format(span).toByteArray(); return super.send(spanBytes); } HttpCollectorClient(String endpoint, Map<String, String> headers);  HttpCollectorClient(String endpoint);  HttpCollectorClient(final String endpoint,
                               final Map<String, String> headers,
                               final CloseableHttpClient httpClient); @Override boolean send(Span span);  }