Remove usage of `mapper.single_type` from xpack tests (elastic/x-pack-elasticsearch#1853)

`index.mapper.single_type` will be removed in master. While there is still
one usage in the security template that we are working on, this change
will remove the remaining usage.

Original commit: elastic/x-pack-elasticsearch@6e7f63b9e0
This commit is contained in:
Simon Willnauer 2017-06-27 13:29:34 +02:00 committed by GitHub
parent 54345e6b8e
commit 9b0639d7f0
4 changed files with 13 additions and 9 deletions

View File

@ -4,8 +4,7 @@
"index": {
"number_of_shards": 1,
"number_of_replicas": 1,
"codec": "best_compression",
"mapping.single_type": false
"codec": "best_compression"
}
},
"mappings" : {

View File

@ -7,6 +7,7 @@ package org.elasticsearch.integration;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.ElasticsearchSecurityException;
import org.elasticsearch.Version;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.get.GetResponse;
@ -37,6 +38,7 @@ import org.elasticsearch.search.sort.SortMode;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.SecurityIntegTestCase;
import org.elasticsearch.xpack.XPackPlugin;
import org.elasticsearch.xpack.XPackSettings;
@ -71,7 +73,8 @@ public class DocumentLevelSecurityTests extends SecurityIntegTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(XPackPlugin.class, ParentJoinPlugin.class);
return Arrays.asList(XPackPlugin.class, ParentJoinPlugin.class,
InternalSettingsPlugin.class);
}
@Override
@ -584,7 +587,7 @@ public class DocumentLevelSecurityTests extends SecurityIntegTestCase {
public void testChildrenAggregation() throws Exception {
assertAcked(client().admin().indices().prepareCreate("test")
.setSettings("mapping.single_type", false)
.setSettings("index.version.created", Version.V_5_6_0.id)
.addMapping("type1", "field1", "type=text", "field2", "type=text")
.addMapping("type2", "_parent", "type=type1", "field3", "type=text,fielddata=true")
);
@ -641,7 +644,7 @@ public class DocumentLevelSecurityTests extends SecurityIntegTestCase {
public void testParentChild_parentField() {
assertAcked(prepareCreate("test")
.setSettings("mapping.single_type", false)
.setSettings("index.version.created", Version.V_5_6_0.id)
.addMapping("parent")
.addMapping("child", "_parent", "type=parent", "field1", "type=text", "field2", "type=text", "field3", "type=text"));
ensureGreen();

View File

@ -7,6 +7,7 @@ package org.elasticsearch.integration;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.ElasticsearchSecurityException;
import org.elasticsearch.Version;
import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.fieldstats.FieldStatsResponse;
@ -35,6 +36,7 @@ import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.SecurityIntegTestCase;
import org.elasticsearch.xpack.XPackPlugin;
import org.elasticsearch.xpack.XPackSettings;
@ -72,7 +74,8 @@ public class FieldLevelSecurityTests extends SecurityIntegTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(XPackPlugin.class, ParentJoinPlugin.class);
return Arrays.asList(XPackPlugin.class, ParentJoinPlugin.class,
InternalSettingsPlugin.class);
}
@Override
@ -1300,7 +1303,7 @@ public class FieldLevelSecurityTests extends SecurityIntegTestCase {
public void testParentChild_parentField() {
assertAcked(prepareCreate("test")
.setSettings("mapping.single_type", false)
.setSettings("index.version.created", Version.V_5_6_0.id)
.addMapping("parent")
.addMapping("child", "_parent", "type=parent"));
ensureGreen();

View File

@ -4,8 +4,7 @@
"index": {
"number_of_shards": 1,
"number_of_replicas": 1,
"codec": "best_compression",
"mapping.single_type": false
"codec": "best_compression"
}
},
"mappings" : {