From f699383bb9d1bd5986242f37563bd8af9f43f9cd Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Thu, 16 Nov 2023 18:30:45 +0000 Subject: [PATCH] Use correct equalTo value a character not string Signed-off-by: Peter Nied --- .../org/opensearch/test/framework/cluster/TestRestClient.java | 4 ++-- .../org/opensearch/security/test/helper/rest/RestHelper.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/integrationTest/java/org/opensearch/test/framework/cluster/TestRestClient.java b/src/integrationTest/java/org/opensearch/test/framework/cluster/TestRestClient.java index ffdd5d481b..d95af715af 100644 --- a/src/integrationTest/java/org/opensearch/test/framework/cluster/TestRestClient.java +++ b/src/integrationTest/java/org/opensearch/test/framework/cluster/TestRestClient.java @@ -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('{')) ); } } diff --git a/src/test/java/org/opensearch/security/test/helper/rest/RestHelper.java b/src/test/java/org/opensearch/security/test/helper/rest/RestHelper.java index ecab086908..7d91e6bcef 100644 --- a/src/test/java/org/opensearch/security/test/helper/rest/RestHelper.java +++ b/src/test/java/org/opensearch/security/test/helper/rest/RestHelper.java @@ -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('{')) ); } }