diff options
Diffstat (limited to 'core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java b/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java index 2e1a00afc2..cab27d74c7 100644 --- a/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java +++ b/core/src/test/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java @@ -25,6 +25,7 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESIntegTestCase; @@ -44,9 +45,9 @@ public class WaitActiveShardCountIT extends ESIntegTestCase { assertAcked(createIndexResponse); // indexing, by default, will work (waiting for one shard copy only) - client().prepareIndex("test", "type1", "1").setSource(source("1", "test")).execute().actionGet(); + client().prepareIndex("test", "type1", "1").setSource(source("1", "test"), XContentType.JSON).execute().actionGet(); try { - client().prepareIndex("test", "type1", "1").setSource(source("1", "test")) + client().prepareIndex("test", "type1", "1").setSource(source("1", "test"), XContentType.JSON) .setWaitForActiveShards(2) // wait for 2 active shard copies .setTimeout(timeValueMillis(100)).execute().actionGet(); fail("can't index, does not enough active shard copies"); @@ -70,12 +71,12 @@ public class WaitActiveShardCountIT extends ESIntegTestCase { assertThat(clusterHealth.getStatus(), equalTo(ClusterHealthStatus.YELLOW)); // this should work, since we now have two - client().prepareIndex("test", "type1", "1").setSource(source("1", "test")) + client().prepareIndex("test", "type1", "1").setSource(source("1", "test"), XContentType.JSON) .setWaitForActiveShards(2) .setTimeout(timeValueSeconds(1)).execute().actionGet(); try { - client().prepareIndex("test", "type1", "1").setSource(source("1", "test")) + client().prepareIndex("test", "type1", "1").setSource(source("1", "test"), XContentType.JSON) .setWaitForActiveShards(ActiveShardCount.ALL) .setTimeout(timeValueMillis(100)).execute().actionGet(); fail("can't index, not enough active shard copies"); @@ -92,7 +93,7 @@ public class WaitActiveShardCountIT extends ESIntegTestCase { assertThat(clusterHealth.getStatus(), equalTo(ClusterHealthStatus.GREEN)); // this should work, since we now have all shards started - client().prepareIndex("test", "type1", "1").setSource(source("1", "test")) + client().prepareIndex("test", "type1", "1").setSource(source("1", "test"), XContentType.JSON) .setWaitForActiveShards(ActiveShardCount.ALL) .setTimeout(timeValueSeconds(1)).execute().actionGet(); } |