diff --git a/src/test/java/org/elasticsearch/test/integration/AbstractSharedClusterTest.java b/src/test/java/org/elasticsearch/test/integration/AbstractSharedClusterTest.java index f6406cecf9c..b7294b89184 100644 --- a/src/test/java/org/elasticsearch/test/integration/AbstractSharedClusterTest.java +++ b/src/test/java/org/elasticsearch/test/integration/AbstractSharedClusterTest.java @@ -18,18 +18,9 @@ */ package org.elasticsearch.test.integration; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; - +import com.google.common.base.Joiner; +import com.google.common.collect.Iterators; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; - -import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder; @@ -55,8 +46,15 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; -import com.google.common.base.Joiner; -import com.google.common.collect.Iterators; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; /** * This abstract base testcase reuses a cluster instance internally and might @@ -317,7 +315,7 @@ public abstract class AbstractSharedClusterTest extends ElasticsearchTestCase { } protected boolean indexExists(String index) { - IndicesExistsResponse actionGet = client().admin().indices().prepareExists("test1234565").execute().actionGet(); + IndicesExistsResponse actionGet = client().admin().indices().prepareExists(index).execute().actionGet(); return actionGet.isExists(); } diff --git a/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java b/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java index a8f68840c5a..8f9d26e99d1 100644 --- a/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java +++ b/src/test/java/org/elasticsearch/test/integration/document/DocumentActionsTests.java @@ -22,7 +22,6 @@ package org.elasticsearch.test.integration.document; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse; -import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; import org.elasticsearch.action.admin.indices.flush.FlushResponse; import org.elasticsearch.action.admin.indices.optimize.OptimizeResponse; import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; @@ -35,11 +34,8 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading; import org.elasticsearch.action.support.replication.ReplicationType; import org.elasticsearch.common.Unicode; -import org.elasticsearch.common.settings.ImmutableSettings; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; - import org.elasticsearch.test.integration.AbstractSharedClusterTest; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -99,7 +95,7 @@ public class DocumentActionsTests extends AbstractSharedClusterTest { assertThat(refreshResponse.getSuccessfulShards(), equalTo(10)); logger.info("--> index exists?"); - assertThat(indexExists(getConcreteIndexName()), equalTo(false)); + assertThat(indexExists(getConcreteIndexName()), equalTo(true)); logger.info("--> index exists?, fake index"); assertThat(indexExists("test1234565"), equalTo(false));