@@ -311,7 +311,8 @@ public void testIllegalDynamicTemplateUnknownFieldType() throws Exception {
311
311
DocumentMapper mapper = mapperService .merge ("type" , new CompressedXContent (Strings .toString (mapping )), MergeReason .MAPPING_UPDATE );
312
312
assertThat (mapper .mappingSource ().toString (), containsString ("\" type\" :\" string\" " ));
313
313
assertWarnings ("dynamic template [my_template] has invalid content [{\" match_mapping_type\" :\" string\" ,\" mapping\" :{\" type\" :" +
314
- "\" string\" }}], caused by [No mapper found for type [string]]" );
314
+ "\" string\" }}], attempted to validate it with the following match_mapping_type: [[string]], " +
315
+ "caused by [No mapper found for type [string]]" );
315
316
}
316
317
317
318
public void testIllegalDynamicTemplateUnknownAttribute () throws Exception {
@@ -340,6 +341,7 @@ public void testIllegalDynamicTemplateUnknownAttribute() throws Exception {
340
341
assertThat (mapper .mappingSource ().toString (), containsString ("\" foo\" :\" bar\" " ));
341
342
assertWarnings ("dynamic template [my_template] has invalid content [{\" match_mapping_type\" :\" string\" ,\" mapping\" :{" +
342
343
"\" foo\" :\" bar\" ,\" type\" :\" keyword\" }}], " +
344
+ "attempted to validate it with the following match_mapping_type: [[string]], " +
343
345
"caused by [unknown parameter [foo] on mapper [__dynamic__my_template] of type [keyword]]" );
344
346
}
345
347
@@ -368,7 +370,8 @@ public void testIllegalDynamicTemplateInvalidAttribute() throws Exception {
368
370
DocumentMapper mapper = mapperService .merge ("type" , new CompressedXContent (Strings .toString (mapping )), MergeReason .MAPPING_UPDATE );
369
371
assertThat (mapper .mappingSource ().toString (), containsString ("\" analyzer\" :\" foobar\" " ));
370
372
assertWarnings ("dynamic template [my_template] has invalid content [{\" match_mapping_type\" :\" string\" ,\" mapping\" :{" +
371
- "\" analyzer\" :\" foobar\" ,\" type\" :\" text\" }}], caused by [analyzer [foobar] has not been configured in mappings]" );
373
+ "\" analyzer\" :\" foobar\" ,\" type\" :\" text\" }}], attempted to validate it with the following match_mapping_type: [[string]], " +
374
+ "caused by [analyzer [foobar] has not been configured in mappings]" );
372
375
}
373
376
374
377
public void testIllegalDynamicTemplateNoMappingType () throws Exception {
@@ -437,10 +440,14 @@ public void testIllegalDynamicTemplateNoMappingType() throws Exception {
437
440
if (useMatchMappingType ) {
438
441
assertWarnings ("dynamic template [my_template] has invalid content [{\" match_mapping_type\" :\" *\" ,\" mapping\" :{" +
439
442
"\" foo\" :\" bar\" ,\" type\" :\" {dynamic_type}\" }}], " +
443
+ "attempted to validate it with the following match_mapping_type: " +
444
+ "[[object, string, long, double, boolean, date, binary]], " +
440
445
"caused by [unknown parameter [foo] on mapper [__dynamic__my_template] of type [binary]]" );
441
446
} else {
442
447
assertWarnings ("dynamic template [my_template] has invalid content [{\" match\" :\" string_*\" ,\" mapping\" :{" +
443
448
"\" foo\" :\" bar\" ,\" type\" :\" {dynamic_type}\" }}], " +
449
+ "attempted to validate it with the following match_mapping_type: " +
450
+ "[[object, string, long, double, boolean, date, binary]], " +
444
451
"caused by [unknown parameter [foo] on mapper [__dynamic__my_template] of type [binary]]" );
445
452
}
446
453
}
0 commit comments