Skip to content

Commit

Permalink
Adjusted the Dapr HTTP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Ciocanu committed Feb 16, 2025
1 parent 293d386 commit 1714ce8
Show file tree
Hide file tree
Showing 3 changed files with 375 additions and 246 deletions.
7 changes: 6 additions & 1 deletion sdk/src/main/java/io/dapr/client/DaprHttp.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public int getStatusCode() {
*/
private static final byte[] EMPTY_BYTES = new byte[0];

/**
* Empty Body Publisher
*/
private static final HttpRequest.BodyPublisher EMPTY_BODY_PUBLISHER = HttpRequest.BodyPublishers.noBody();

/**
* Endpoint used to communicate to Dapr's HTTP endpoint.
*/
Expand Down Expand Up @@ -289,7 +294,7 @@ private CompletableFuture<Response> doInvokeApi(
requestBuilder.DELETE();
} else if (HttpMethods.HEAD.name().equals(method)) {
// HTTP HEAD is not exposed as a normal method
requestBuilder.method(HttpMethods.HEAD.name(), null);
requestBuilder.method(HttpMethods.HEAD.name(), EMPTY_BODY_PUBLISHER);
} else {
requestBuilder.method(method, body);
}
Expand Down
Loading

0 comments on commit 1714ce8

Please sign in to comment.