From d9df0042426381f038819495961ed9af3939aecc Mon Sep 17 00:00:00 2001 From: John Mazanec Date: Thu, 5 Jan 2023 11:19:22 -0800 Subject: [PATCH] Fix test issues Signed-off-by: John Mazanec --- .../knn/index/codec/KNN940Codec/KNN940CodecTests.java | 6 +----- .../knn/index/codec/KNN950Codec/KNN950CodecTests.java | 11 ++--------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/opensearch/knn/index/codec/KNN940Codec/KNN940CodecTests.java b/src/test/java/org/opensearch/knn/index/codec/KNN940Codec/KNN940CodecTests.java index 4872af25a..805edac9d 100644 --- a/src/test/java/org/opensearch/knn/index/codec/KNN940Codec/KNN940CodecTests.java +++ b/src/test/java/org/opensearch/knn/index/codec/KNN940Codec/KNN940CodecTests.java @@ -24,11 +24,7 @@ public void testBuildFromModelTemplate() throws InterruptedException, ExecutionE // Ensure that the codec is able to return the correct per field knn vectors format for codec public void testCodecSetsCustomPerFieldKnnVectorsFormat() { - final Codec codec = KNN940Codec.builder() - .delegate(V_9_4_0.getDefaultCodecDelegate()) - .knnVectorsFormat(V_9_4_0.getPerFieldKnnVectorsFormat()) - .build(); - + final Codec codec = new KNN940Codec(); assertTrue(codec.knnVectorsFormat() instanceof KNN940PerFieldKnnVectorsFormat); } } diff --git a/src/test/java/org/opensearch/knn/index/codec/KNN950Codec/KNN950CodecTests.java b/src/test/java/org/opensearch/knn/index/codec/KNN950Codec/KNN950CodecTests.java index bc315b13b..8eafb6a4a 100644 --- a/src/test/java/org/opensearch/knn/index/codec/KNN950Codec/KNN950CodecTests.java +++ b/src/test/java/org/opensearch/knn/index/codec/KNN950Codec/KNN950CodecTests.java @@ -9,14 +9,11 @@ import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat; import org.opensearch.index.mapper.MapperService; -import org.opensearch.knn.index.codec.KNN940Codec.KNN940Codec; -import org.opensearch.knn.index.codec.KNN940Codec.KNN940PerFieldKnnVectorsFormat; import org.opensearch.knn.index.codec.KNNCodecTestCase; import java.util.Optional; import java.util.function.Function; -import static org.opensearch.knn.index.codec.KNNCodecVersion.V_9_4_0; import static org.opensearch.knn.index.codec.KNNCodecVersion.V_9_5_0; public class KNN950CodecTests extends KNNCodecTestCase { @@ -33,12 +30,8 @@ public void testBuildFromModelTemplate() { // Ensure that the codec is able to return the correct per field knn vectors format for codec public void testCodecSetsCustomPerFieldKnnVectorsFormat() { - final Codec codec = KNN940Codec.builder() - .delegate(V_9_4_0.getDefaultCodecDelegate()) - .knnVectorsFormat(V_9_4_0.getPerFieldKnnVectorsFormat()) - .build(); - - assertTrue(codec.knnVectorsFormat() instanceof KNN940PerFieldKnnVectorsFormat); + final Codec codec = new KNN950Codec(); + assertTrue(codec.knnVectorsFormat() instanceof KNN950PerFieldKnnVectorsFormat); } // IMPORTANT: When this Codec is moved to a backwards Codec, this test needs to be removed, because it attempts to