Skip to content

Commit 1714ce8

Browse files
author
Artur Ciocanu
committed
Adjusted the Dapr HTTP tests
1 parent 293d386 commit 1714ce8

File tree

3 files changed

+375
-246
lines changed

3 files changed

+375
-246
lines changed

sdk/src/main/java/io/dapr/client/DaprHttp.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ public int getStatusCode() {
129129
*/
130130
private static final byte[] EMPTY_BYTES = new byte[0];
131131

132+
/**
133+
* Empty Body Publisher
134+
*/
135+
private static final HttpRequest.BodyPublisher EMPTY_BODY_PUBLISHER = HttpRequest.BodyPublishers.noBody();
136+
132137
/**
133138
* Endpoint used to communicate to Dapr's HTTP endpoint.
134139
*/
@@ -289,7 +294,7 @@ private CompletableFuture<Response> doInvokeApi(
289294
requestBuilder.DELETE();
290295
} else if (HttpMethods.HEAD.name().equals(method)) {
291296
// HTTP HEAD is not exposed as a normal method
292-
requestBuilder.method(HttpMethods.HEAD.name(), null);
297+
requestBuilder.method(HttpMethods.HEAD.name(), EMPTY_BODY_PUBLISHER);
293298
} else {
294299
requestBuilder.method(method, body);
295300
}

0 commit comments

Comments
 (0)