From 650633feeae9a6ce5dd71ca12d2971f6f01e9663 Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Tue, 24 Sep 2024 12:03:58 +0200 Subject: [PATCH] Make ClientRequestBase mock friendly Signed-off-by: Jorge Bescos Gascon --- .../java/io/helidon/webclient/api/ClientRequestBase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webclient/api/src/main/java/io/helidon/webclient/api/ClientRequestBase.java b/webclient/api/src/main/java/io/helidon/webclient/api/ClientRequestBase.java index bdd3f053203..d1cec37df6e 100644 --- a/webclient/api/src/main/java/io/helidon/webclient/api/ClientRequestBase.java +++ b/webclient/api/src/main/java/io/helidon/webclient/api/ClientRequestBase.java @@ -262,7 +262,7 @@ public R request() { } @Override - public final R submit(Object entity) { + public R submit(Object entity) { if (!(entity instanceof byte[] bytes && bytes.length == 0)) { rejectHeadWithEntity(); } @@ -271,7 +271,7 @@ public final R submit(Object entity) { } @Override - public final R outputStream(OutputStreamHandler outputStreamConsumer) { + public R outputStream(OutputStreamHandler outputStreamConsumer) { rejectHeadWithEntity(); additionalHeaders(); return doOutputStream(outputStreamConsumer); @@ -481,7 +481,7 @@ private String resolvePathParams(String path) { } private void rejectHeadWithEntity() { - if (this.method.equals(Method.HEAD)) { + if (Method.HEAD.equals(this.method)) { throw new IllegalArgumentException("Payload in method '" + Method.HEAD + "' has no defined semantics"); } }