Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/124650.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 124650
summary: "Follow-up: Remove Logger Calls in Tests"
area: Relevance
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down