@@ -65,7 +65,6 @@ protected void registerParameters(ParameterChecker checker) throws IOException {
6565 topMapping (b -> b .startObject (SourceFieldMapper .NAME ).field ("mode" , "synthetic" ).endObject ()),
6666 dm -> {
6767 assertTrue (dm .metadataMapper (SourceFieldMapper .class ).isSynthetic ());
68- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
6968 }
7069 );
7170 checker .registerConflictCheck ("includes" , b -> b .array ("includes" , "foo*" ));
@@ -74,7 +73,7 @@ protected void registerParameters(ParameterChecker checker) throws IOException {
7473 "mode" ,
7574 topMapping (b -> b .startObject (SourceFieldMapper .NAME ).field ("mode" , "synthetic" ).endObject ()),
7675 topMapping (b -> b .startObject (SourceFieldMapper .NAME ).field ("mode" , "stored" ).endObject ()),
77- dm -> assertWarnings ( SourceFieldMapper . DEPRECATION_WARNING )
76+ d -> {}
7877 );
7978 }
8079
@@ -211,22 +210,19 @@ public void testSyntheticDisabledNotSupported() {
211210 )
212211 );
213212 assertThat (e .getMessage (), containsString ("Cannot set both [mode] and [enabled] parameters" ));
214- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
215213 }
216214
217215 public void testSyntheticUpdates () throws Exception {
218216 MapperService mapperService = createMapperService ("""
219217 { "_doc" : { "_source" : { "mode" : "synthetic" } } }
220218 """ );
221- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
222219 SourceFieldMapper mapper = mapperService .documentMapper ().sourceMapper ();
223220 assertTrue (mapper .enabled ());
224221 assertTrue (mapper .isSynthetic ());
225222
226223 merge (mapperService , """
227224 { "_doc" : { "_source" : { "mode" : "synthetic" } } }
228225 """ );
229- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
230226 mapper = mapperService .documentMapper ().sourceMapper ();
231227 assertTrue (mapper .enabled ());
232228 assertTrue (mapper .isSynthetic ());
@@ -239,12 +235,10 @@ public void testSyntheticUpdates() throws Exception {
239235 """ ));
240236
241237 assertThat (e .getMessage (), containsString ("Cannot update parameter [mode] from [synthetic] to [stored]" ));
242- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
243238
244239 merge (mapperService , """
245240 { "_doc" : { "_source" : { "mode" : "disabled" } } }
246241 """ );
247- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
248242
249243 mapper = mapperService .documentMapper ().sourceMapper ();
250244 assertFalse (mapper .enabled ());
@@ -281,7 +275,6 @@ public void testSupportsNonDefaultParameterValues() throws IOException {
281275 topMapping (b -> b .startObject ("_source" ).field ("mode" , randomBoolean () ? "synthetic" : "stored" ).endObject ())
282276 ).documentMapper ().sourceMapper ();
283277 assertThat (sourceFieldMapper , notNullValue ());
284- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
285278 }
286279 Exception e = expectThrows (
287280 MapperParsingException .class ,
@@ -313,8 +306,6 @@ public void testSupportsNonDefaultParameterValues() throws IOException {
313306 .documentMapper ()
314307 .sourceMapper ()
315308 );
316- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
317-
318309 assertThat (e .getMessage (), containsString ("Parameter [mode=disabled] is not allowed in source" ));
319310
320311 e = expectThrows (
@@ -423,7 +414,6 @@ public void testRecoverySourceWithSyntheticSource() throws IOException {
423414 ParsedDocument doc = docMapper .parse (source (b -> { b .field ("field1" , "value1" ); }));
424415 assertNotNull (doc .rootDoc ().getField ("_recovery_source" ));
425416 assertThat (doc .rootDoc ().getField ("_recovery_source" ).binaryValue (), equalTo (new BytesRef ("{\" field1\" :\" value1\" }" )));
426- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
427417 }
428418 {
429419 Settings settings = Settings .builder ().put (INDICES_RECOVERY_SOURCE_ENABLED_SETTING .getKey (), false ).build ();
@@ -434,7 +424,6 @@ public void testRecoverySourceWithSyntheticSource() throws IOException {
434424 DocumentMapper docMapper = mapperService .documentMapper ();
435425 ParsedDocument doc = docMapper .parse (source (b -> b .field ("field1" , "value1" )));
436426 assertNull (doc .rootDoc ().getField ("_recovery_source" ));
437- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
438427 }
439428 }
440429
@@ -629,7 +618,6 @@ public void testRecoverySourceWithLogsCustom() throws IOException {
629618 ParsedDocument doc = docMapper .parse (source (b -> { b .field ("@timestamp" , "2012-02-13" ); }));
630619 assertNotNull (doc .rootDoc ().getField ("_recovery_source" ));
631620 assertThat (doc .rootDoc ().getField ("_recovery_source" ).binaryValue (), equalTo (new BytesRef ("{\" @timestamp\" :\" 2012-02-13\" }" )));
632- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
633621 }
634622 {
635623 Settings settings = Settings .builder ()
@@ -640,7 +628,6 @@ public void testRecoverySourceWithLogsCustom() throws IOException {
640628 DocumentMapper docMapper = mapperService .documentMapper ();
641629 ParsedDocument doc = docMapper .parse (source (b -> b .field ("@timestamp" , "2012-02-13" )));
642630 assertNull (doc .rootDoc ().getField ("_recovery_source" ));
643- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
644631 }
645632 }
646633
@@ -709,7 +696,6 @@ public void testRecoverySourceWithTimeSeriesCustom() throws IOException {
709696 doc .rootDoc ().getField ("_recovery_source" ).binaryValue (),
710697 equalTo (new BytesRef ("{\" @timestamp\" :\" 2012-02-13\" ,\" field\" :\" value1\" }" ))
711698 );
712- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
713699 }
714700 {
715701 Settings settings = Settings .builder ()
@@ -723,7 +709,6 @@ public void testRecoverySourceWithTimeSeriesCustom() throws IOException {
723709 source ("123" , b -> b .field ("@timestamp" , "2012-02-13" ).field ("field" , randomAlphaOfLength (5 )), null )
724710 );
725711 assertNull (doc .rootDoc ().getField ("_recovery_source" ));
726- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
727712 }
728713 }
729714}
0 commit comments