Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static ImmutableHttpResponse create(int statusCode, String statusMessage, byte[]
return new AutoValue_ImmutableHttpResponse(statusCode, statusMessage, responseBody);
}

// The sender hands off the response bytes, so copying the array would allocate for every reply.
@SuppressWarnings("mutable")
@Override
public abstract byte[] getResponseBody();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void sendInternal_RetryableIoException() throws IOException, InterruptedExceptio

@ParameterizedTest
@MethodSource("retryAfterArgs")
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // Mockito uses a raw class token for HttpResponse<InputStream>.
void sendInternal_retryAfter(String retryAfter, long minDelayNanos, long maxDelayNanos)
throws IOException, InterruptedException {
java.net.http.HttpResponse<InputStream> retryableResponse =
Expand Down Expand Up @@ -334,7 +334,7 @@ void connectTimeout() {
assertThat(httpClient.connectTimeout().get()).isEqualTo(Duration.ofSeconds(10)));
}

@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // Mockito uses a raw class token for HttpResponse<InputStream>.
@Test
void send_successfulResponse_callsOnResponse() throws Exception {
java.net.http.HttpResponse<InputStream> mockJdkResponse =
Expand Down Expand Up @@ -382,7 +382,7 @@ void send_successfulResponse_callsOnResponse() throws Exception {
}
}

@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // Mockito uses a raw class token for HttpResponse<InputStream>.
@Test
void sendInternal_unsupportedContentEncoding_closesBody() throws Exception {
AtomicBoolean closed = new AtomicBoolean();
Expand Down Expand Up @@ -496,7 +496,7 @@ void send_rejectedExecution_callsOnError() {
assertThat(responseRef.get()).isNull();
}

@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // Mockito uses a raw class token for HttpResponse<InputStream>.
@Test
void send_suppressesInstrumentation() throws Exception {
java.net.http.HttpResponse<InputStream> mockJdkResponse =
Expand Down
Loading