From 1df8e11a91135508c2709e541268f28a17dfedf5 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura Date: Wed, 18 Dec 2024 19:17:46 -0500 Subject: [PATCH] Fixes tests Signed-off-by: Darshit Chanpura --- .../opensearch/accesscontrol/resources/CreatedByTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/org/opensearch/accesscontrol/resources/CreatedByTests.java b/server/src/test/java/org/opensearch/accesscontrol/resources/CreatedByTests.java index 52b0bfd01c7fc..4ea1e52974c25 100644 --- a/server/src/test/java/org/opensearch/accesscontrol/resources/CreatedByTests.java +++ b/server/src/test/java/org/opensearch/accesscontrol/resources/CreatedByTests.java @@ -85,7 +85,7 @@ public void testFromXContentThrowsExceptionWhenUserFieldIsMissing() throws IOExc exception = assertThrows(IllegalArgumentException.class, () -> CreatedBy.fromXContent(parser)); } - MatcherAssert.assertThat("user field is required", equalTo(exception.getMessage())); + MatcherAssert.assertThat("user is required", equalTo(exception.getMessage())); } public void testFromXContentWithEmptyInput() throws IOException { @@ -120,7 +120,7 @@ public void testFromXContentWithMissingUser() throws IOException { exception = assertThrows(IllegalArgumentException.class, () -> CreatedBy.fromXContent(parser)); } - MatcherAssert.assertThat("user field is required", equalTo(exception.getMessage())); + MatcherAssert.assertThat("user is required", equalTo(exception.getMessage())); } public void testFromXContentWithMissingUserField() throws IOException { @@ -266,7 +266,7 @@ public void test_fromXContent_missingUserField() throws IOException { exception = assertThrows(IllegalArgumentException.class, () -> { CreatedBy.fromXContent(parser); }); } - MatcherAssert.assertThat("user field is required", equalTo(exception.getMessage())); + MatcherAssert.assertThat("user is required", equalTo(exception.getMessage())); } public void test_toXContent_serializesCorrectly() throws IOException {