1313import org .elasticsearch .index .query .QueryShardException ;
1414import org .elasticsearch .xpack .esql .VerificationException ;
1515import org .elasticsearch .xpack .esql .action .AbstractEsqlIntegTestCase ;
16- import org .elasticsearch .xpack .esql .action .ColumnInfoImpl ;
17- import org .elasticsearch .xpack .esql .core .type .DataType ;
1816import org .junit .Before ;
1917
2018import java .util .List ;
2119
22- import static org .elasticsearch .test .ListMatcher .matchesList ;
23- import static org .elasticsearch .test .MapMatcher .assertMap ;
2420import static org .elasticsearch .test .hamcrest .ElasticsearchAssertions .assertAcked ;
25- import static org .elasticsearch .xpack .esql .EsqlTestUtils .getValuesList ;
2621import static org .hamcrest .CoreMatchers .containsString ;
27- import static org .hamcrest .Matchers .equalTo ;
2822
2923public class QueryStringIT extends AbstractEsqlIntegTestCase {
3024
@@ -42,11 +36,9 @@ public void testSimpleQueryString() {
4236 """ ;
4337
4438 try (var resp = run (query )) {
45- assertThat (resp .columns ().stream ().map (ColumnInfoImpl ::name ).toList (), equalTo (List .of ("id" )));
46- assertThat (resp .columns ().stream ().map (ColumnInfoImpl ::type ).map (DataType ::toString ).toList (), equalTo (List .of ("INTEGER" )));
47- // values
48- List <List <Object >> values = getValuesList (resp );
49- assertMap (values , matchesList ().item (List .of (1 )).item (List .of (3 )).item (List .of (4 )).item (List .of (5 )));
39+ assertColumnNames (resp .columns (), List .of ("id" ));
40+ assertColumnTypes (resp .columns (), List .of ("integer" ));
41+ assertValues (resp .values (), List .of (List .of (1 ), List .of (3 ), List .of (4 ), List .of (5 )));
5042 }
5143 }
5244
@@ -58,11 +50,9 @@ public void testMultiFieldQueryString() {
5850 """ ;
5951
6052 try (var resp = run (query )) {
61- assertThat (resp .columns ().stream ().map (ColumnInfoImpl ::name ).toList (), equalTo (List .of ("id" )));
62- assertThat (resp .columns ().stream ().map (ColumnInfoImpl ::type ).map (DataType ::toString ).toList (), equalTo (List .of ("INTEGER" )));
63- // values
64- List <List <Object >> values = getValuesList (resp );
65- assertThat (values .size (), equalTo (5 ));
53+ assertColumnNames (resp .columns (), List .of ("id" ));
54+ assertColumnTypes (resp .columns (), List .of ("integer" ));
55+ assertValuesInAnyOrder (resp .values (), List .of (List .of (1 ), List .of (2 ), List .of (3 ), List .of (4 ), List .of (5 )));
6656 }
6757 }
6858
0 commit comments