[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:
parent
80f7c1dcc9
commit
17e6932bf3
|
@ -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")
|
||||
|
|
|
@ -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));
|
||||
|
Loading…
Reference in New Issue