[Tests] Rename DocumentMapperMergeTests (#34121)

Renaming to simply DocumentMapperTests to indicate this is where other unit
tests should go. Also removing outdates Todo in DocumentMapperParserTests.
This commit is contained in:
Christoph Büscher 2018-10-01 10:29:19 +02:00 committed by GitHub
parent 80f7c1dcc9
commit 17e6932bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -27,7 +27,6 @@ import org.elasticsearch.test.ESSingleNodeTestCase;
import static org.hamcrest.Matchers.equalTo;
// TODO: move this test...it doesn't need to be by itself
public class DocumentMapperParserTests extends ESSingleNodeTestCase {
public void testTypeLevel() throws Exception {
String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("type")

View File

@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
public class DocumentMapperMergeTests extends ESSingleNodeTestCase {
public class DocumentMapperTests extends ESSingleNodeTestCase {
public void test1Merge() throws Exception {
@ -51,7 +51,8 @@ public class DocumentMapperMergeTests extends ESSingleNodeTestCase {
String stage2Mapping = Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("person").startObject("properties")
.startObject("name").field("type", "text").endObject()
.startObject("age").field("type", "integer").endObject()
.startObject("obj1").startObject("properties").startObject("prop1").field("type", "integer").endObject().endObject().endObject()
.startObject("obj1").startObject("properties").startObject("prop1").field("type", "integer").endObject().endObject()
.endObject()
.endObject().endObject().endObject());
DocumentMapper stage2 = parser.parse("person", new CompressedXContent(stage2Mapping));
@ -70,7 +71,8 @@ public class DocumentMapperMergeTests extends ESSingleNodeTestCase {
DocumentMapper mapper = parser.parse("type1", new CompressedXContent(objectMapping));
assertNull(mapper.root().dynamic());
String withDynamicMapping = Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("type1").field("dynamic", "false").endObject().endObject());
String withDynamicMapping = Strings.toString(
XContentFactory.jsonBuilder().startObject().startObject("type1").field("dynamic", "false").endObject().endObject());
DocumentMapper withDynamicMapper = parser.parse("type1", new CompressedXContent(withDynamicMapping));
assertThat(withDynamicMapper.root().dynamic(), equalTo(ObjectMapper.Dynamic.FALSE));