Skip to content

Commit cb4a043

Browse files
Fix the unit test
1 parent 080d3bb commit cb4a043

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/SemanticMatchTestCase.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.List;
2020
import java.util.Map;
2121

22+
import static org.elasticsearch.test.ListMatcher.matchesList;
23+
import static org.elasticsearch.test.MapMatcher.matchesMap;
2224
import static org.hamcrest.Matchers.equalTo;
2325
import static org.hamcrest.core.StringContains.containsString;
2426

@@ -65,8 +67,12 @@ public void testCopyToWithSemanticText() throws IOException {
6567
""";
6668
Map<String, Object> result = runEsqlQuery(query);
6769

68-
assertEquals(List.of("text_field", "semantic_text_field"), result.get("columns"));
69-
assertEquals(List.of("inference test", "inference test"), result.get("values"));
70+
assertResultMap(
71+
result,
72+
matchesList().item(matchesMap().entry("name", "semantic_text_field").entry("type", "text"))
73+
.item(matchesMap().entry("name", "text_field").entry("type", "text")),
74+
List.of(List.of("inference test", "inference test"))
75+
);
7076
}
7177

7278
@Before
@@ -107,7 +113,7 @@ public void setUpIndices() throws IOException {
107113
"properties": {
108114
"semantic_text_field": {
109115
"type": "semantic_text",
110-
"inference_id": "test_sparse_inference"
116+
"inference_id": "test_dense_inference"
111117
},
112118
"text_field": {
113119
"type": "text",

0 commit comments

Comments
 (0)