Skip to content

Commit

Permalink
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]>
  • Loading branch information
peternied committed Nov 16, 2023
1 parent 77e800e commit ca12473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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('{'))
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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('{''))
);
}
}
Expand Down

0 comments on commit ca12473

Please sign in to comment.