use of org.elasticsearch.plugins.MapperPlugin in project elasticsearch by elastic.
the class IndicesModuleTests method testDuplicateBuiltinMapper.
public void testDuplicateBuiltinMapper() {
List<MapperPlugin> plugins = Arrays.asList(new MapperPlugin() {
@Override
public Map<String, Mapper.TypeParser> getMappers() {
return Collections.singletonMap(TextFieldMapper.CONTENT_TYPE, new FakeMapperParser());
}
});
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new IndicesModule(plugins));
assertThat(e.getMessage(), Matchers.containsString("already registered"));
}
use of org.elasticsearch.plugins.MapperPlugin in project elasticsearch by elastic.
the class IndicesModuleTests method testDuplicateFieldNamesMapper.
public void testDuplicateFieldNamesMapper() {
List<MapperPlugin> plugins = Arrays.asList(new MapperPlugin() {
@Override
public Map<String, MetadataFieldMapper.TypeParser> getMetadataMappers() {
return Collections.singletonMap(FieldNamesFieldMapper.NAME, new FakeMetadataMapperParser());
}
});
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new IndicesModule(plugins));
assertThat(e.getMessage(), Matchers.containsString("cannot contain metadata mapper [_field_names]"));
}
Aggregations