From 8f461e2f91e11d57282fed7c3966b1a94ebbbd55 Mon Sep 17 00:00:00 2001 From: yuye-aws Date: Tue, 27 Feb 2024 14:11:09 +0800 Subject: [PATCH] fix tests for getProcessors in neural search Signed-off-by: yuye-aws --- .../opensearch/neuralsearch/plugin/NeuralSearchTests.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java b/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java index 2a66f6992..cb3869868 100644 --- a/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java +++ b/src/test/java/org/opensearch/neuralsearch/plugin/NeuralSearchTests.java @@ -5,11 +5,14 @@ package org.opensearch.neuralsearch.plugin; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import java.util.List; import java.util.Map; import java.util.Optional; +import org.opensearch.common.settings.Settings; +import org.opensearch.env.Environment; import org.opensearch.indices.IndicesService; import org.opensearch.ingest.IngestService; import org.opensearch.ingest.Processor; @@ -57,8 +60,11 @@ public void testQueryPhaseSearcher() { public void testProcessors() { NeuralSearch plugin = new NeuralSearch(); + Settings settings = Settings.builder().build(); + Environment environment = mock(Environment.class); + when(environment.settings()).thenReturn(settings); Processor.Parameters processorParams = new Processor.Parameters( - null, + environment, null, null, null,