Skip to content

Commit

Permalink
Fix tests that depend on an instance of IngestService now instead of …
Browse files Browse the repository at this point in the history
…invoking static methods
  • Loading branch information
carlosdelest committed Dec 14, 2023
1 parent 16b8c62 commit fbdbbfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.elasticsearch.index.IndexingPressure;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.indices.EmptySystemIndices;
import org.elasticsearch.ingest.IngestServiceTests;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.MockUtils;
Expand Down Expand Up @@ -118,7 +119,7 @@ public boolean hasIndexAbstraction(String indexAbstraction, ClusterState state)
threadPool,
transportService,
clusterService,
null,
IngestServiceTests.createIngestService(),
null,
mock(ActionFilters.class),
indexNameExpressionResolver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.elasticsearch.action.support.ActionTestUtils;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.DataStream;
import org.elasticsearch.cluster.metadata.IndexAbstraction;
Expand All @@ -30,6 +31,7 @@
import org.elasticsearch.cluster.node.DiscoveryNodeUtils;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.IndexNotFoundException;
Expand All @@ -40,6 +42,9 @@
import org.elasticsearch.indices.EmptySystemIndices;
import org.elasticsearch.indices.SystemIndexDescriptorUtils;
import org.elasticsearch.indices.SystemIndices;
import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.ingest.IngestServiceTests;
import org.elasticsearch.plugins.internal.DocumentParsingObserver;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.VersionUtils;
import org.elasticsearch.test.index.IndexVersionUtils;
Expand All @@ -61,6 +66,9 @@
import static org.elasticsearch.test.ClusterServiceUtils.createClusterService;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TransportBulkActionTests extends ESTestCase {

Expand All @@ -82,7 +90,7 @@ class TestTransportBulkAction extends TransportBulkAction {
TransportBulkActionTests.this.threadPool,
transportService,
clusterService,
null,
IngestServiceTests.createIngestService(),
null,
new ActionFilters(Collections.emptySet()),
new Resolver(),
Expand Down

0 comments on commit fbdbbfa

Please sign in to comment.