use of org.opensearch.index.mapper.DocumentMapperParser in project OpenSearch by opensearch-project.
the class PercolatorFieldMapperTests method testEmptyName.
public void testEmptyName() throws Exception {
String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("").field("type", "percolator").endObject().endObject().endObject().endObject());
DocumentMapperParser parser = mapperService.documentMapperParser();
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> parser.parse("type1", new CompressedXContent(mapping)));
assertThat(e.getMessage(), containsString("name cannot be empty string"));
}
Aggregations