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 @@ -75,21 +75,6 @@ public HttpResponse execute(HttpRequest request) throws UncheckedIOException {
public WebSocket openSocket(HttpRequest request, WebSocket.Listener listener) {
throw new UnsupportedOperationException("openSocket");
}

@Override
public <T>
java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
java.net.http.HttpRequest request,
java.net.http.HttpResponse.BodyHandler<T> handler) {
throw new UnsupportedOperationException("sendAsyncNative is not supported");
}

@Override
public <T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler)
throws java.io.IOException, InterruptedException {
throw new UnsupportedOperationException("sendNative is not supported");
}
};
}

Expand Down
17 changes: 0 additions & 17 deletions java/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,23 +297,6 @@ public WebSocket openSocket(HttpRequest request, WebSocket.Listener listener) {
public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
return handler.execute(req);
}

@Override
public <T>
java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>>
sendAsyncNative(
java.net.http.HttpRequest request,
java.net.http.HttpResponse.BodyHandler<T> handler) {
throw new UnsupportedOperationException("sendAsyncNative is not supported");
}

@Override
public <T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request,
java.net.http.HttpResponse.BodyHandler<T> handler)
throws java.io.IOException, InterruptedException {
throw new UnsupportedOperationException("sendNative is not supported");
}
};
}
};
Expand Down
17 changes: 11 additions & 6 deletions java/src/org/openqa/selenium/remote/http/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ default void close() {}
* @param handler the BodyHandler that determines how to handle the response body
* @return a CompletableFuture containing the HTTP response
*/
<T> CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler);
default <T> CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
java.net.http.HttpRequest request,
java.net.http.HttpResponse.BodyHandler<T> handler) {
throw new UnsupportedOperationException("sendAsyncNative is not supported by this HttpClient implementation");
}

/**
* Sends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.
Expand All @@ -60,10 +63,12 @@ <T> CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
* @throws java.io.IOException if an I/O error occurs
* @throws InterruptedException if the operation is interrupted
*/
<T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler)
throws java.io.IOException, InterruptedException;

default <T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request,
java.net.http.HttpResponse.BodyHandler<T> handler)
throws java.io.IOException, InterruptedException {
throw new UnsupportedOperationException("sendNative is not supported by this HttpClient implementation");
}
interface Factory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ public WebSocket openSocket(HttpRequest request, WebSocket.Listener listener) {
throw new UnsupportedOperationException("openSocket");
}

@Override
public <T> java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler) {
throw new UnsupportedOperationException("sendAsyncNative");
}

@Override
public <T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler)
throws java.io.IOException, InterruptedException {
throw new UnsupportedOperationException("sendNative");
}

public static class Factory implements HttpClient.Factory {

private final Routable handler;
Expand Down
14 changes: 0 additions & 14 deletions java/test/org/openqa/selenium/remote/ProtocolHandshakeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,5 @@ String getRequestPayload() {
public WebSocket openSocket(HttpRequest request, WebSocket.Listener listener) {
throw new UnsupportedOperationException("openSocket");
}

@Override
public <T>
java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler) {
throw new UnsupportedOperationException("sendAsyncNative");
}

@Override
public <T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler)
throws java.io.IOException, InterruptedException {
throw new UnsupportedOperationException("sendNative");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ public java.net.http.HttpClient.Version version() {
return CompletableFuture.completedFuture(mockResponse);
}



Comment on lines +246 to +247
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded new lines.

@Override
public <T> java.net.http.HttpResponse<T> sendNative(
java.net.http.HttpRequest request, java.net.http.HttpResponse.BodyHandler<T> handler)
Expand Down
Loading