diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java index 64c41f56045..054158a74c7 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java @@ -255,7 +255,7 @@ public abstract class MapperTestCase extends MapperServiceTestCase { return true; } - public final void testDeprecatedBoost() throws IOException { + public void testDeprecatedBoost() throws IOException { assumeTrue("Does not support [boost] parameter", supportsOrIgnoresBoost()); createMapperService(fieldMapping(b -> { minimalMapping(b); diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java index eb2c76a81c8..542065512e7 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java @@ -59,6 +59,20 @@ public class SparseVectorFieldMapperTests extends MapperTestCase { builder.startObject().field("1", 1).endObject(); } + @Override + public void testDeprecatedBoost() throws IOException { + assumeTrue("Does not support [boost] parameter", supportsOrIgnoresBoost()); + createMapperService(fieldMapping(b -> { + minimalMapping(b); + b.field("boost", 2.0); + })); + String type = typeName(); + String[] warnings = new String[] { + "The [sparse_vector] field type is deprecated and will be removed in 8.0.", + "Parameter [boost] has no effect on type [" + type + "] and will be removed in future" }; + allowedWarnings(warnings); + } + @Override protected Collection getPlugins() { return Collections.singletonList(new Vectors());