Skip to content

Commit

Permalink
Make ClientRequestBase mock friendly
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Sep 24, 2024
1 parent 6e9b457 commit 650633f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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);
Expand Down Expand Up @@ -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");
}
}
Expand Down

0 comments on commit 650633f

Please sign in to comment.