Skip to content

Commit

Permalink
404 means skip, not break the http server test
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Cole committed Feb 12, 2018
1 parent 66585ba commit 9cebbb5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import brave.SpanCustomizer;
import brave.propagation.ExtraFieldPropagation;
import brave.sampler.Sampler;
import java.io.IOException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
Expand Down Expand Up @@ -262,13 +261,14 @@ public void httpPathTagExcludesQueryParams() throws Exception {
.containsEntry("http.path", "/foo");
}

protected Response get(String path) throws IOException {
protected Response get(String path) throws Exception {
return get(new Request.Builder().url(url(path)).build());
}

protected Response get(Request request) throws IOException {
protected Response get(Request request) throws Exception {
try (Response response = client.newCall(request).execute()) {
if (response.code() == 404) {
takeSpan();
throw new AssumptionViolatedException(request.url().encodedPath() + " not supported");
}
if (!HttpHeaders.hasBody(response)) return response;
Expand Down

0 comments on commit 9cebbb5

Please sign in to comment.