From 85c932a1cd38dd9ff66000e2da57ba13f9fbe400 Mon Sep 17 00:00:00 2001 From: Mridula Sivanandan Date: Wed, 12 Mar 2025 14:26:45 +0000 Subject: [PATCH 1/3] Removed logger and also fixed the nitpick comments --- .../xpack/application/rules/QueryRuleTests.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/QueryRuleTests.java b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/QueryRuleTests.java index 57e8adbdff764..a0bf53f1c88e4 100644 --- a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/QueryRuleTests.java +++ b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/QueryRuleTests.java @@ -126,8 +126,7 @@ public void testNumericValidationWithEmptyValues() throws IOException { IllegalArgumentException.class, () -> QueryRule.fromXContentBytes(new BytesArray(content), XContentType.JSON) ); - logger.info("Actual error message: " + e.getMessage()); - assertTrue(e.getMessage().contains("failed to parse field [criteria]")); + assertThat(e.getMessage(), containsString("failed to parse field [criteria]")); } public void testToXContent() throws IOException { @@ -158,11 +157,7 @@ public void testToXContentEmptyCriteria() throws IOException { IllegalArgumentException.class, () -> QueryRule.fromXContentBytes(new BytesArray(content), XContentType.JSON) ); - logger.info("Actual error message for empty criteria: " + e.getMessage()); - assertTrue( - "Error message [" + e.getMessage() + "] should contain 'Failed to build [query_rule]'", - e.getMessage().contains("Failed to build [query_rule]") - ); + assertThat(e.getMessage(), containsString("Failed to build [query_rule]")); } public void testToXContentValidPinnedRulesWithIds() throws IOException { From f67792d434ecf0157697a80dabb763d469dc60bf Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 12 Mar 2025 15:19:01 +0000 Subject: [PATCH 2/3] Update docs/changelog/124650.yaml --- docs/changelog/124650.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/124650.yaml diff --git a/docs/changelog/124650.yaml b/docs/changelog/124650.yaml new file mode 100644 index 0000000000000..d80191993791c --- /dev/null +++ b/docs/changelog/124650.yaml @@ -0,0 +1,5 @@ +pr: 124650 +summary: "Follow-up: Remove Logger Calls in Tests" +area: Relevance +type: enhancement +issues: [] From e6797fb1e094065bd87cd6b3249ef3f5ece3d99e Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 12 Mar 2025 15:39:47 +0000 Subject: [PATCH 3/3] Delete docs/changelog/124650.yaml --- docs/changelog/124650.yaml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 docs/changelog/124650.yaml diff --git a/docs/changelog/124650.yaml b/docs/changelog/124650.yaml deleted file mode 100644 index d80191993791c..0000000000000 --- a/docs/changelog/124650.yaml +++ /dev/null @@ -1,5 +0,0 @@ -pr: 124650 -summary: "Follow-up: Remove Logger Calls in Tests" -area: Relevance -type: enhancement -issues: []