Skip to content

Commit

Permalink
fix(vertx): Java8 compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Jan 28, 2025
1 parent 832c138 commit 685d67b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -112,7 +113,7 @@ public void cancel() {
};
resp.handler(buffer -> {
try {
consumer.consume(List.of(ByteBuffer.wrap(buffer.getBytes())), result);
consumer.consume(Collections.singletonList(ByteBuffer.wrap(buffer.getBytes())), result);
} catch (Exception e) {
resp.request().reset();
result.done().completeExceptionally(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void testZeroTimeouts() {
HttpClient.Builder builder = factory.newBuilder();

// should build and be usable without an issue
try (HttpClient client = builder.connectTimeout(0, TimeUnit.MILLISECONDS).build();) {
try (HttpClient client = builder.connectTimeout(0, TimeUnit.MILLISECONDS).build()) {
assertNotNull(client.newHttpRequestBuilder().uri("http://localhost").build());
}
}
Expand Down Expand Up @@ -65,7 +65,7 @@ void createsVertxInstanceWhenNoSharedVertx() {
@Test
void doesntCloseSharedVertxInstanceWhenClientIsClosed() {
final Vertx vertx = Vertx.vertx();
final var builder = new VertxHttpClientFactory(vertx).newBuilder();
final VertxHttpClientBuilder<VertxHttpClientFactory> builder = new VertxHttpClientFactory(vertx).newBuilder();
builder.build().close();
assertThat(builder.vertx)
.asInstanceOf(InstanceOfAssertFactories.type(VertxImpl.class))
Expand All @@ -75,7 +75,7 @@ void doesntCloseSharedVertxInstanceWhenClientIsClosed() {

@Test
void closesVertxInstanceWhenClientIsClosed() {
final var builder = new VertxHttpClientFactory().newBuilder();
final VertxHttpClientBuilder<VertxHttpClientFactory> builder = new VertxHttpClientFactory().newBuilder();
builder.build().close();
assertThat(builder.vertx)
.asInstanceOf(InstanceOfAssertFactories.type(VertxImpl.class))
Expand Down

0 comments on commit 685d67b

Please sign in to comment.