Skip to content

Commit

Permalink
Test fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Oct 24, 2023
1 parent 46e2634 commit 1b42edf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.action.inference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FieldInferenceBulkRequestPreprocessor extends AbstractBulkRequestPr

public static final String SEMANTIC_TEXT_ORIGIN = "semantic_text";

private final Client client;
private final OriginSettingClient client;

public FieldInferenceBulkRequestPreprocessor(Supplier<DocumentParsingObserver> documentParsingObserver, Client client) {
super(documentParsingObserver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public boolean hasIndexAbstraction(String indexAbstraction, ClusterState state)
clusterService,
null,
null,
null,
mock(ActionFilters.class),
indexNameExpressionResolver,
new IndexingPressure(Settings.EMPTY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.elasticsearch.index.IndexingPressure;
import org.elasticsearch.indices.EmptySystemIndices;
import org.elasticsearch.indices.TestIndexNameExpressionResolver;
import org.elasticsearch.ingest.FieldInferenceBulkRequestPreprocessor;
import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.test.ESTestCase;
Expand Down Expand Up @@ -93,6 +94,7 @@ public class TransportBulkActionIngestTests extends ESTestCase {
TransportService transportService;
ClusterService clusterService;
IngestService ingestService;
FieldInferenceBulkRequestPreprocessor fieldInferenceBulkRequestPreprocessor;
ThreadPool threadPool;

/** Arguments to callbacks we want to capture, but which require generics, so we must use @Captor */
Expand Down Expand Up @@ -133,6 +135,7 @@ class TestTransportBulkAction extends TransportBulkAction {
transportService,
clusterService,
ingestService,
fieldInferenceBulkRequestPreprocessor,
null,
new ActionFilters(Collections.emptySet()),
TestIndexNameExpressionResolver.newInstance(),
Expand Down Expand Up @@ -229,6 +232,7 @@ public void setupAction() {
}).when(clusterService).addStateApplier(any(ClusterStateApplier.class));
// setup the mocked ingest service for capturing calls
ingestService = mock(IngestService.class);
fieldInferenceBulkRequestPreprocessor = mock(FieldInferenceBulkRequestPreprocessor.class);
action = new TestTransportBulkAction();
singleItemBulkWriteAction = new TestSingleItemBulkWriteAction(action);
reset(transportService); // call on construction of action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class TestTransportBulkAction extends TransportBulkAction {
clusterService,
null,
null,
null,
new ActionFilters(Collections.emptySet()),
new Resolver(),
new IndexingPressure(Settings.EMPTY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
import org.elasticsearch.indices.recovery.RecoverySettings;
import org.elasticsearch.indices.recovery.SnapshotFilesProvider;
import org.elasticsearch.indices.recovery.plan.PeerOnlyRecoveryPlannerService;
import org.elasticsearch.ingest.FieldInferenceBulkRequestPreprocessor;
import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.monitor.StatusInfo;
import org.elasticsearch.node.ResponseCollectorService;
Expand Down Expand Up @@ -1936,6 +1937,7 @@ protected void assertSnapshotOrGenericThread() {
null,
() -> DocumentParsingObserver.EMPTY_INSTANCE
),
new FieldInferenceBulkRequestPreprocessor(() -> DocumentParsingObserver.EMPTY_INSTANCE, client),
client,
actionFilters,
indexNameExpressionResolver,
Expand Down

0 comments on commit 1b42edf

Please sign in to comment.