2929import static org .elasticsearch .xpack .esql .ConfigurationTestUtils .randomConfiguration ;
3030import static org .elasticsearch .xpack .esql .expression .function .EsqlFunctionRegistry .def ;
3131import static org .elasticsearch .xpack .esql .expression .function .FunctionResolutionStrategy .DEFAULT ;
32- import static org .hamcrest .Matchers .endsWith ;
32+ import static org .hamcrest .Matchers .containsString ;
3333import static org .hamcrest .Matchers .is ;
3434import static org .mockito .Mockito .mock ;
3535
@@ -54,11 +54,11 @@ public void testBinaryFunction() {
5454
5555 // No children aren't supported
5656 ParsingException e = expectThrows (ParsingException .class , () -> uf (DEFAULT ).buildResolved (randomConfiguration (), def ));
57- assertThat (e .getMessage (), endsWith ("expects exactly two arguments" ));
57+ assertThat (e .getMessage (), containsString ("expects exactly two arguments" ));
5858
5959 // One child isn't supported
6060 e = expectThrows (ParsingException .class , () -> uf (DEFAULT , mock (Expression .class )).buildResolved (randomConfiguration (), def ));
61- assertThat (e .getMessage (), endsWith ("expects exactly two arguments" ));
61+ assertThat (e .getMessage (), containsString ("expects exactly two arguments" ));
6262
6363 // Many children aren't supported
6464 e = expectThrows (
@@ -68,7 +68,7 @@ public void testBinaryFunction() {
6868 def
6969 )
7070 );
71- assertThat (e .getMessage (), endsWith ("expects exactly two arguments" ));
71+ assertThat (e .getMessage (), containsString ("expects exactly two arguments" ));
7272 }
7373
7474 public void testAliasNameIsTheSameAsAFunctionName () {
@@ -138,14 +138,14 @@ public void testUnaryFunction() {
138138
139139 // No children aren't supported
140140 ParsingException e = expectThrows (ParsingException .class , () -> uf (DEFAULT ).buildResolved (randomConfiguration (), def ));
141- assertThat (e .getMessage (), endsWith ("expects exactly one argument" ));
141+ assertThat (e .getMessage (), containsString ("expects exactly one argument" ));
142142
143143 // Multiple children aren't supported
144144 e = expectThrows (
145145 ParsingException .class ,
146146 () -> uf (DEFAULT , mock (Expression .class ), mock (Expression .class )).buildResolved (randomConfiguration (), def )
147147 );
148- assertThat (e .getMessage (), endsWith ("expects exactly one argument" ));
148+ assertThat (e .getMessage (), containsString ("expects exactly one argument" ));
149149 }
150150
151151 public void testConfigurationOptionalFunction () {
0 commit comments