Skip to content
Merged
Changes from all 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
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