File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,7 @@ public void testNumericValidationWithEmptyValues() throws IOException {
126126 IllegalArgumentException .class ,
127127 () -> QueryRule .fromXContentBytes (new BytesArray (content ), XContentType .JSON )
128128 );
129- logger .info ("Actual error message: " + e .getMessage ());
130- assertTrue (e .getMessage ().contains ("failed to parse field [criteria]" ));
129+ assertThat (e .getMessage (), containsString ("failed to parse field [criteria]" ));
131130 }
132131
133132 public void testToXContent () throws IOException {
@@ -158,11 +157,7 @@ public void testToXContentEmptyCriteria() throws IOException {
158157 IllegalArgumentException .class ,
159158 () -> QueryRule .fromXContentBytes (new BytesArray (content ), XContentType .JSON )
160159 );
161- logger .info ("Actual error message for empty criteria: " + e .getMessage ());
162- assertTrue (
163- "Error message [" + e .getMessage () + "] should contain 'Failed to build [query_rule]'" ,
164- e .getMessage ().contains ("Failed to build [query_rule]" )
165- );
160+ assertThat (e .getMessage (), containsString ("Failed to build [query_rule]" ));
166161 }
167162
168163 public void testToXContentValidPinnedRulesWithIds () throws IOException {
You can’t perform that action at this time.
0 commit comments