|
18 | 18 | import org.elasticsearch.index.query.RangeQueryBuilder; |
19 | 19 | import org.elasticsearch.index.shard.ShardId; |
20 | 20 | import org.elasticsearch.plugins.Plugin; |
21 | | -import org.elasticsearch.tasks.Task; |
22 | 21 | import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; |
23 | 22 | import org.elasticsearch.test.transport.MockTransportService; |
24 | | -import org.elasticsearch.test.transport.StubbableTransport; |
25 | | -import org.elasticsearch.transport.TransportChannel; |
26 | | -import org.elasticsearch.transport.TransportRequest; |
27 | | -import org.elasticsearch.transport.TransportRequestHandler; |
28 | 23 | import org.elasticsearch.transport.TransportService; |
29 | 24 | import org.elasticsearch.xpack.esql.action.AbstractEsqlIntegTestCase; |
30 | 25 | import org.elasticsearch.xpack.esql.action.EsqlQueryResponse; |
@@ -281,24 +276,13 @@ public void testSkipOnIndexName() { |
281 | 276 | Set<String> queriedIndices = ConcurrentCollections.newConcurrentSet(); |
282 | 277 | for (TransportService ts : internalCluster().getInstances(TransportService.class)) { |
283 | 278 | MockTransportService mockTransportService = as(ts, MockTransportService.class); |
284 | | - mockTransportService.addRequestHandlingBehavior( |
285 | | - ComputeService.DATA_ACTION_NAME, |
286 | | - new StubbableTransport.RequestHandlingBehavior<TransportRequest>() { |
287 | | - @Override |
288 | | - public void messageReceived( |
289 | | - TransportRequestHandler<TransportRequest> handler, |
290 | | - TransportRequest request, |
291 | | - TransportChannel channel, |
292 | | - Task task |
293 | | - ) throws Exception { |
294 | | - DataNodeRequest dataNodeRequest = (DataNodeRequest) request; |
295 | | - for (ShardId shardId : dataNodeRequest.shardIds()) { |
296 | | - queriedIndices.add(shardId.getIndexName()); |
297 | | - } |
298 | | - handler.messageReceived(request, channel, task); |
299 | | - } |
| 279 | + mockTransportService.addRequestHandlingBehavior(ComputeService.DATA_ACTION_NAME, (handler, request, channel, task) -> { |
| 280 | + DataNodeRequest dataNodeRequest = (DataNodeRequest) request; |
| 281 | + for (ShardId shardId : dataNodeRequest.shardIds()) { |
| 282 | + queriedIndices.add(shardId.getIndexName()); |
300 | 283 | } |
301 | | - ); |
| 284 | + handler.messageReceived(request, channel, task); |
| 285 | + }); |
302 | 286 | } |
303 | 287 | try { |
304 | 288 | for (int i = 0; i < numIndices; i++) { |
|
0 commit comments