|
|
|
@ -46,7 +46,7 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
|
|
|
|
|
|
|
|
|
|
private static MockWebServer mockBackEnd;
|
|
|
|
|
|
|
|
|
|
public static String ZIPKIN_URL;
|
|
|
|
|
private static String ZIPKIN_URL;
|
|
|
|
|
|
|
|
|
|
@BeforeAll
|
|
|
|
|
static void beforeAll() throws IOException {
|
|
|
|
@ -92,7 +92,7 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
|
|
|
|
|
void sendSpansShouldSendSpansToZipkin(boolean async) throws IOException, InterruptedException {
|
|
|
|
|
mockBackEnd.enqueue(new MockResponse());
|
|
|
|
|
List<byte[]> encodedSpans = List.of(toByteArray("span1"), toByteArray("span2"));
|
|
|
|
|
this.makeRequest(encodedSpans, async);
|
|
|
|
|
makeRequest(encodedSpans, async);
|
|
|
|
|
|
|
|
|
|
requestAssertions((request) -> {
|
|
|
|
|
assertThat(request.getMethod()).isEqualTo("POST");
|
|
|
|
@ -106,12 +106,12 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
|
|
|
|
|
void sendSpansShouldHandleHttpFailures(boolean async) throws InterruptedException {
|
|
|
|
|
mockBackEnd.enqueue(new MockResponse().setResponseCode(500));
|
|
|
|
|
if (async) {
|
|
|
|
|
CallbackResult callbackResult = this.makeAsyncRequest(List.of());
|
|
|
|
|
CallbackResult callbackResult = makeAsyncRequest(List.of());
|
|
|
|
|
assertThat(callbackResult.success()).isFalse();
|
|
|
|
|
assertThat(callbackResult.error()).isNotNull().hasMessageContaining("500 Internal Server Error");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
assertThatThrownBy(() -> this.makeSyncRequest(List.of())).hasMessageContaining("500 Internal Server Error");
|
|
|
|
|
assertThatThrownBy(() -> makeSyncRequest(List.of())).hasMessageContaining("500 Internal Server Error");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
requestAssertions((request) -> assertThat(request.getMethod()).isEqualTo("POST"));
|
|
|
|
@ -127,7 +127,7 @@ class ZipkinWebClientSenderTests extends ZipkinHttpSenderTests {
|
|
|
|
|
|
|
|
|
|
mockBackEnd.enqueue(new MockResponse());
|
|
|
|
|
|
|
|
|
|
this.makeRequest(List.of(toByteArray(uncompressed)), async);
|
|
|
|
|
makeRequest(List.of(toByteArray(uncompressed)), async);
|
|
|
|
|
|
|
|
|
|
requestAssertions((request) -> {
|
|
|
|
|
assertThat(request.getMethod()).isEqualTo("POST");
|
|
|
|
|