@@ -65,7 +65,6 @@ protected void registerParameters(ParameterChecker checker) throws IOException {
65
65
topMapping (b -> b .startObject (SourceFieldMapper .NAME ).field ("mode" , "synthetic" ).endObject ()),
66
66
dm -> {
67
67
assertTrue (dm .metadataMapper (SourceFieldMapper .class ).isSynthetic ());
68
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
69
68
}
70
69
);
71
70
checker .registerConflictCheck ("includes" , b -> b .array ("includes" , "foo*" ));
@@ -74,7 +73,7 @@ protected void registerParameters(ParameterChecker checker) throws IOException {
74
73
"mode" ,
75
74
topMapping (b -> b .startObject (SourceFieldMapper .NAME ).field ("mode" , "synthetic" ).endObject ()),
76
75
topMapping (b -> b .startObject (SourceFieldMapper .NAME ).field ("mode" , "stored" ).endObject ()),
77
- dm -> assertWarnings ( SourceFieldMapper . DEPRECATION_WARNING )
76
+ d -> {}
78
77
);
79
78
}
80
79
@@ -211,22 +210,19 @@ public void testSyntheticDisabledNotSupported() {
211
210
)
212
211
);
213
212
assertThat (e .getMessage (), containsString ("Cannot set both [mode] and [enabled] parameters" ));
214
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
215
213
}
216
214
217
215
public void testSyntheticUpdates () throws Exception {
218
216
MapperService mapperService = createMapperService ("""
219
217
{ "_doc" : { "_source" : { "mode" : "synthetic" } } }
220
218
""" );
221
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
222
219
SourceFieldMapper mapper = mapperService .documentMapper ().sourceMapper ();
223
220
assertTrue (mapper .enabled ());
224
221
assertTrue (mapper .isSynthetic ());
225
222
226
223
merge (mapperService , """
227
224
{ "_doc" : { "_source" : { "mode" : "synthetic" } } }
228
225
""" );
229
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
230
226
mapper = mapperService .documentMapper ().sourceMapper ();
231
227
assertTrue (mapper .enabled ());
232
228
assertTrue (mapper .isSynthetic ());
@@ -239,12 +235,10 @@ public void testSyntheticUpdates() throws Exception {
239
235
""" ));
240
236
241
237
assertThat (e .getMessage (), containsString ("Cannot update parameter [mode] from [synthetic] to [stored]" ));
242
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
243
238
244
239
merge (mapperService , """
245
240
{ "_doc" : { "_source" : { "mode" : "disabled" } } }
246
241
""" );
247
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
248
242
249
243
mapper = mapperService .documentMapper ().sourceMapper ();
250
244
assertFalse (mapper .enabled ());
@@ -281,7 +275,6 @@ public void testSupportsNonDefaultParameterValues() throws IOException {
281
275
topMapping (b -> b .startObject ("_source" ).field ("mode" , randomBoolean () ? "synthetic" : "stored" ).endObject ())
282
276
).documentMapper ().sourceMapper ();
283
277
assertThat (sourceFieldMapper , notNullValue ());
284
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
285
278
}
286
279
Exception e = expectThrows (
287
280
MapperParsingException .class ,
@@ -313,8 +306,6 @@ public void testSupportsNonDefaultParameterValues() throws IOException {
313
306
.documentMapper ()
314
307
.sourceMapper ()
315
308
);
316
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
317
-
318
309
assertThat (e .getMessage (), containsString ("Parameter [mode=disabled] is not allowed in source" ));
319
310
320
311
e = expectThrows (
@@ -423,7 +414,6 @@ public void testRecoverySourceWithSyntheticSource() throws IOException {
423
414
ParsedDocument doc = docMapper .parse (source (b -> { b .field ("field1" , "value1" ); }));
424
415
assertNotNull (doc .rootDoc ().getField ("_recovery_source" ));
425
416
assertThat (doc .rootDoc ().getField ("_recovery_source" ).binaryValue (), equalTo (new BytesRef ("{\" field1\" :\" value1\" }" )));
426
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
427
417
}
428
418
{
429
419
Settings settings = Settings .builder ().put (INDICES_RECOVERY_SOURCE_ENABLED_SETTING .getKey (), false ).build ();
@@ -434,7 +424,6 @@ public void testRecoverySourceWithSyntheticSource() throws IOException {
434
424
DocumentMapper docMapper = mapperService .documentMapper ();
435
425
ParsedDocument doc = docMapper .parse (source (b -> b .field ("field1" , "value1" )));
436
426
assertNull (doc .rootDoc ().getField ("_recovery_source" ));
437
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
438
427
}
439
428
}
440
429
@@ -629,7 +618,6 @@ public void testRecoverySourceWithLogsCustom() throws IOException {
629
618
ParsedDocument doc = docMapper .parse (source (b -> { b .field ("@timestamp" , "2012-02-13" ); }));
630
619
assertNotNull (doc .rootDoc ().getField ("_recovery_source" ));
631
620
assertThat (doc .rootDoc ().getField ("_recovery_source" ).binaryValue (), equalTo (new BytesRef ("{\" @timestamp\" :\" 2012-02-13\" }" )));
632
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
633
621
}
634
622
{
635
623
Settings settings = Settings .builder ()
@@ -640,7 +628,6 @@ public void testRecoverySourceWithLogsCustom() throws IOException {
640
628
DocumentMapper docMapper = mapperService .documentMapper ();
641
629
ParsedDocument doc = docMapper .parse (source (b -> b .field ("@timestamp" , "2012-02-13" )));
642
630
assertNull (doc .rootDoc ().getField ("_recovery_source" ));
643
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
644
631
}
645
632
}
646
633
@@ -709,7 +696,6 @@ public void testRecoverySourceWithTimeSeriesCustom() throws IOException {
709
696
doc .rootDoc ().getField ("_recovery_source" ).binaryValue (),
710
697
equalTo (new BytesRef ("{\" @timestamp\" :\" 2012-02-13\" ,\" field\" :\" value1\" }" ))
711
698
);
712
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
713
699
}
714
700
{
715
701
Settings settings = Settings .builder ()
@@ -723,7 +709,6 @@ public void testRecoverySourceWithTimeSeriesCustom() throws IOException {
723
709
source ("123" , b -> b .field ("@timestamp" , "2012-02-13" ).field ("field" , randomAlphaOfLength (5 )), null )
724
710
);
725
711
assertNull (doc .rootDoc ().getField ("_recovery_source" ));
726
- assertWarnings (SourceFieldMapper .DEPRECATION_WARNING );
727
712
}
728
713
}
729
714
}
0 commit comments