From b0c21d751d0e1b920f7584bd274b95539ee715c0 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 2 Jul 2014 12:11:00 +0200 Subject: [PATCH] [TEST] Fix SimpleDeleteMappingTests. The failure was hard to reproduce but it looked to me like dynamic mapping updates were overriding the delete mappings request. --- .../indices/mapping/SimpleDeleteMappingTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/elasticsearch/indices/mapping/SimpleDeleteMappingTests.java b/src/test/java/org/elasticsearch/indices/mapping/SimpleDeleteMappingTests.java index 684ef340ca4..a394d5f8e12 100644 --- a/src/test/java/org/elasticsearch/indices/mapping/SimpleDeleteMappingTests.java +++ b/src/test/java/org/elasticsearch/indices/mapping/SimpleDeleteMappingTests.java @@ -23,17 +23,16 @@ import com.google.common.base.Predicate; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.count.CountResponse; -import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.MappingMetaData; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.test.ElasticsearchIntegrationTest; -import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.junit.Test; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.notNullValue; /** * @@ -42,6 +41,7 @@ public class SimpleDeleteMappingTests extends ElasticsearchIntegrationTest { @Test public void simpleDeleteMapping() throws Exception { + assertAcked(prepareCreate("test").addMapping("type1", "value", "type=string").execute().actionGet()); for (int i = 0; i < 10; i++) { client().prepareIndex("test", "type1", Integer.toString(i)).setSource(jsonBuilder().startObject() .field("value", "test" + i)