remove dots in field names tests for mapping api

This commit is contained in:
Ryan Ernst 2016-08-10 17:11:02 -07:00
parent 9e6629d092
commit 82fc86553c
1 changed files with 0 additions and 14 deletions

View File

@ -958,20 +958,6 @@ public class DocumentParserTests extends ESSingleNodeTestCase {
} }
} }
public void testHazardousFieldNames() throws Exception {
IndexService indexService = createIndex("test");
DocumentMapperParser mapperParser = indexService.mapperService().documentMapperParser();
String mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
.startObject("foo.bar").field("type", "text").endObject()
.endObject().endObject().endObject().string();
try {
mapperParser.parse("type", new CompressedXContent(mapping));
fail("Mapping parse should have failed");
} catch (MapperParsingException e) {
assertTrue(e.getMessage(), e.getMessage().contains("cannot contain '.'"));
}
}
public void testNoLevel() throws Exception { public void testNoLevel() throws Exception {
String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string();