Skip to content

Commit 4402042

Browse files
committed
fix other test
1 parent f5dc712 commit 4402042

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistryTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import static org.elasticsearch.xpack.esql.ConfigurationTestUtils.randomConfiguration;
3030
import static org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry.def;
3131
import static org.elasticsearch.xpack.esql.expression.function.FunctionResolutionStrategy.DEFAULT;
32-
import static org.hamcrest.Matchers.endsWith;
32+
import static org.hamcrest.Matchers.containsString;
3333
import static org.hamcrest.Matchers.is;
3434
import 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

Comments
 (0)