Skip to content

Commit 5ee6f14

Browse files
committed
Fix test scenario compatibility issues
- Use FieldValue.of() instead of query(String) for 7.x compatibility (query(String) shorthand only exists in 8.0+) - Fix 8.16/8.17 versions: use 8.16.6/8.17.10 to match available elasticsearch-rest-client versions - Fix 9.x versions: use 9.0.8/9.1.10/9.2.8/9.3.3 to match available elasticsearch-rest-client versions - All 29 versions verified locally against Maven Central
1 parent c020951 commit 5ee6f14

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

test/plugin/scenarios/elasticsearch-java-9.x-scenario/support-version.list

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
# limitations under the License.
1616

1717
# co.elastic.clients:elasticsearch-java 9.x (requires JDK 17)
18-
9.0.11
19-
9.1.12
18+
# Versions must match elasticsearch-rest-client available versions
19+
9.0.8
20+
9.1.10
2021
9.2.8
21-
9.3.4
22+
9.3.3

test/plugin/scenarios/elasticsearch-java-scenario/src/main/java/org/apache/skywalking/apm/testcase/elasticsearch/controller/CaseController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import co.elastic.clients.elasticsearch.core.DeleteResponse;
2626
import co.elastic.clients.elasticsearch.indices.CreateIndexResponse;
2727
import co.elastic.clients.elasticsearch.indices.DeleteIndexResponse;
28+
import co.elastic.clients.elasticsearch._types.FieldValue;
2829
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
2930
import co.elastic.clients.transport.rest_client.RestClientTransport;
3031
import org.apache.http.HttpHost;
@@ -80,7 +81,7 @@ public String elasticsearch() throws IOException {
8081
// Search
8182
SearchResponse<Map> searchResp = client.search(s -> s
8283
.index("test-index")
83-
.query(q -> q.match(m -> m.field("name").query("test"))), Map.class);
84+
.query(q -> q.match(m -> m.field("name").query(FieldValue.of("test")))), Map.class);
8485

8586
// Delete document
8687
DeleteResponse deleteResp = client.delete(d -> d.index("test-index").id("1"));

test/plugin/scenarios/elasticsearch-java-scenario/support-version.list

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
8.13.4
3737
8.14.3
3838
8.15.5
39-
8.16.7
40-
8.17.11
39+
8.16.6
40+
8.17.10
4141
8.18.8
4242
8.19.14

0 commit comments

Comments
 (0)