diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionInferenceTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionInferenceTests.java index 71fd62df1620d..c10687055c632 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionInferenceTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionInferenceTests.java @@ -278,11 +278,16 @@ private void expectTransportShardBulkActionRequest(int requestSize) { var listener = (ActionListener) invocation.getArguments()[2]; var bulkShardRequest = (BulkShardRequest) invocation.getArguments()[1]; ShardId shardId = new ShardId(INDEX_NAME, "UUID", 0); - BulkItemResponse[] bulkItemResponses = Arrays.stream(bulkShardRequest.items()).map(item -> BulkItemResponse.success(item.id(), DocWriteRequest.OpType.INDEX, new IndexResponse( - shardId, - "id", - 0, 0, 0, true - ))).toArray(BulkItemResponse[]::new); + BulkItemResponse[] bulkItemResponses = Arrays.stream(bulkShardRequest.items()) + .map(item -> BulkItemResponse.success( + item.id(), + DocWriteRequest.OpType.INDEX, + new IndexResponse( + shardId, + "id", + 0, 0, 0, true) + ) + ).toArray(BulkItemResponse[]::new); listener.onResponse(new BulkShardResponse(shardId, bulkItemResponses)); return null; @@ -301,7 +306,8 @@ private void expectInferenceRequest(String modelId, String... inferenceTexts) { listener.onResponse( new InferenceAction.Response( new SparseEmbeddingResults( - request.getInput().stream() + request.getInput() + .stream() .map( text -> new SparseEmbeddingResults.Embedding( List.of(new SparseEmbeddingResults.WeightedToken(text.toString(), 1.0f)),