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