From b2e551ab3b9328a3f6d576e4c2839a3ce3d2eaee Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Tue, 24 Oct 2023 17:50:29 +0200 Subject: [PATCH] Fix tests --- ...TransportBulkActionIndicesThatCannotBeCreatedTests.java | 7 +++++-- .../action/bulk/TransportBulkActionTests.java | 7 +++++-- .../action/bulk/TransportBulkActionTookTests.java | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java index 545d99d61d2a3..957da1bfd1d37 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java @@ -31,6 +31,8 @@ import org.elasticsearch.index.IndexingPressure; import org.elasticsearch.index.VersionType; import org.elasticsearch.indices.EmptySystemIndices; +import org.elasticsearch.ingest.FieldInferenceBulkRequestPreprocessor; +import org.elasticsearch.ingest.IngestService; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.MockUtils; @@ -43,6 +45,7 @@ import java.util.function.Consumer; import java.util.function.Function; +import static java.util.Collections.emptyList; import static java.util.Collections.emptySet; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -125,8 +128,8 @@ public boolean hasIndexAbstraction(String indexAbstraction, ClusterState state) threadPool, transportService, clusterService, - null, - null, + mock(IngestService.class), + mock(FieldInferenceBulkRequestPreprocessor.class), null, mock(ActionFilters.class), indexNameExpressionResolver, diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java index 5a9bbde833110..8ef09ae8285a4 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java @@ -39,6 +39,8 @@ import org.elasticsearch.indices.EmptySystemIndices; import org.elasticsearch.indices.SystemIndexDescriptorUtils; import org.elasticsearch.indices.SystemIndices; +import org.elasticsearch.ingest.FieldInferenceBulkRequestPreprocessor; +import org.elasticsearch.ingest.IngestService; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.test.index.IndexVersionUtils; @@ -60,6 +62,7 @@ import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; +import static org.mockito.Mockito.mock; public class TransportBulkActionTests extends ESTestCase { @@ -81,8 +84,8 @@ class TestTransportBulkAction extends TransportBulkAction { TransportBulkActionTests.this.threadPool, transportService, clusterService, - null, - null, + mock(IngestService.class), + mock(FieldInferenceBulkRequestPreprocessor.class), null, new ActionFilters(Collections.emptySet()), new Resolver(), diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java index cf4d5cab8b617..167a5cb76564d 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java @@ -32,6 +32,8 @@ import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.IndexingPressure; import org.elasticsearch.indices.EmptySystemIndices; +import org.elasticsearch.ingest.FieldInferenceBulkRequestPreprocessor; +import org.elasticsearch.ingest.IngestService; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; @@ -58,6 +60,7 @@ import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.mockito.Mockito.mock; public class TransportBulkActionTookTests extends ESTestCase { @@ -246,8 +249,8 @@ static class TestTransportBulkAction extends TransportBulkAction { threadPool, transportService, clusterService, - null, - null, + mock(IngestService.class), + mock(FieldInferenceBulkRequestPreprocessor.class), client, actionFilters, indexNameExpressionResolver,