diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/HybridSearchIT.java b/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/HybridSearchIT.java index 95924112c..44671ed4a 100644 --- a/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/HybridSearchIT.java +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/HybridSearchIT.java @@ -20,7 +20,6 @@ import static org.opensearch.neuralsearch.util.TestUtils.getModelId; import org.opensearch.index.query.QueryBuilder; -import org.opensearch.index.query.QueryBuilders; import org.opensearch.knn.index.query.rescore.RescoreContext; import org.opensearch.neuralsearch.query.HybridQueryBuilder; import org.opensearch.neuralsearch.query.NeuralQueryBuilder; diff --git a/src/test/java/org/opensearch/neuralsearch/query/HybridQueryBuilderTests.java b/src/test/java/org/opensearch/neuralsearch/query/HybridQueryBuilderTests.java index 6383f1ed0..0dfd2071c 100644 --- a/src/test/java/org/opensearch/neuralsearch/query/HybridQueryBuilderTests.java +++ b/src/test/java/org/opensearch/neuralsearch/query/HybridQueryBuilderTests.java @@ -236,11 +236,13 @@ public void testDoToQuery_whenPaginationDepthIsGreaterThan10000_thenBuildSuccess IndexSettings indexSettings = new IndexSettings(indexMetadata, settings); when(mockQueryShardContext.getIndexSettings()).thenReturn(indexSettings); - NeuralQueryBuilder neuralQueryBuilder = new NeuralQueryBuilder().fieldName(VECTOR_FIELD_NAME) + NeuralQueryBuilder neuralQueryBuilder = NeuralQueryBuilder.builder() + .fieldName(VECTOR_FIELD_NAME) .queryText(QUERY_TEXT) .modelId(MODEL_ID) .k(K) - .vectorSupplier(TEST_VECTOR_SUPPLIER); + .vectorSupplier(TEST_VECTOR_SUPPLIER) + .build(); queryBuilder.add(neuralQueryBuilder); IllegalArgumentException exception = expectThrows( @@ -270,11 +272,13 @@ public void testDoToQuery_whenPaginationDepthIsLessThanZero_thenBuildSuccessfull IndexSettings indexSettings = new IndexSettings(indexMetadata, settings); when(mockQueryShardContext.getIndexSettings()).thenReturn(indexSettings); - NeuralQueryBuilder neuralQueryBuilder = new NeuralQueryBuilder().fieldName(VECTOR_FIELD_NAME) + NeuralQueryBuilder neuralQueryBuilder = NeuralQueryBuilder.builder() + .fieldName(VECTOR_FIELD_NAME) .queryText(QUERY_TEXT) .modelId(MODEL_ID) .k(K) - .vectorSupplier(TEST_VECTOR_SUPPLIER); + .vectorSupplier(TEST_VECTOR_SUPPLIER) + .build(); queryBuilder.add(neuralQueryBuilder); IllegalArgumentException exception = expectThrows(