private void testNoConflictWhileMergingAndMappingChanged( XContentBuilder mapping, XContentBuilder mappingUpdate, XContentBuilder expectedMapping) throws IOException { IndexService indexService = createIndex("test", ImmutableSettings.settingsBuilder().build(), "type", mapping); // simulate like in MetaDataMappingService#putMapping DocumentMapper.MergeResult mergeResult = indexService .mapperService() .documentMapper("type") .merge( indexService .mapperService() .parse("type", new CompressedString(mappingUpdate.bytes()), true), DocumentMapper.MergeFlags.mergeFlags().simulate(false)); // assure we have no conflicts assertThat(mergeResult.conflicts().length, equalTo(0)); // make sure mappings applied CompressedString mappingAfterUpdate = indexService.mapperService().documentMapper("type").mappingSource(); assertThat(mappingAfterUpdate.toString(), equalTo(expectedMapping.string())); }