Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use correct equalTo value a character not string
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
peternied committed Nov 16, 2023
1 parent 77e800e commit 1f424f7
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -298,13 +298,13 @@ public HttpResponse(CloseableHttpResponse inner) throws IllegalStateException, I
private void verifyContentType() {
final String contentType = this.getHeader(HttpHeaders.CONTENT_TYPE).getValue();
if (contentType.equals("application/json")) {
assertThat("Response body format was not json, body: " + body, body.charAt(0), equalTo("{"));
assertThat("Response body format was not json, body: " + body, body.charAt(0), equalTo('{'));
} else {
if (body.length() != 0) {
assertThat(
"Response body format was json, whereas content-type was " + contentType + ", body: " + body,
body.charAt(0),
not(equalTo("{"))
not(equalTo('{'))
);
}
}
Original file line number Diff line number Diff line change
@@ -422,12 +422,12 @@ private void verifyBodyContentType() {
.orElseThrow(() -> new RuntimeException("No content type found. Headers:\n" + getHeaders() + "\n\nBody:\n" + body));

if (contentType.equals("application/json")) {
assertThat("Response body format was not json, body: " + body, body.charAt(0), equalTo("{"));
assertThat("Response body format was not json, body: " + body, body.charAt(0), equalTo('{'));
} else {
assertThat(
"Response body format was json, whereas content-type was " + contentType + ", body: " + body,
body.charAt(0),
not(equalTo("{"))
not(equalTo('{'))
);
}
}

0 comments on commit 1f424f7

Please sign in to comment.