From 77e04290896c62b5a0eea8f0b868db554d03fcf1 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 13 Jun 2014 11:35:15 +0200 Subject: [PATCH] [TEST] Verify the flush reponse --- src/test/java/org/elasticsearch/get/GetActionTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/get/GetActionTests.java b/src/test/java/org/elasticsearch/get/GetActionTests.java index e01f5335660..1213876caeb 100644 --- a/src/test/java/org/elasticsearch/get/GetActionTests.java +++ b/src/test/java/org/elasticsearch/get/GetActionTests.java @@ -22,6 +22,7 @@ package org.elasticsearch.get; import org.elasticsearch.ElasticsearchIllegalArgumentException; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; +import org.elasticsearch.action.admin.indices.flush.FlushResponse; import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.get.MultiGetRequest; @@ -40,6 +41,8 @@ import java.util.Map; import static org.elasticsearch.client.Requests.clusterHealthRequest; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.*; public class GetActionTests extends ElasticsearchIntegrationTest { @@ -850,7 +853,9 @@ public class GetActionTests extends ElasticsearchIntegrationTest { assertThat(getResponse.getField(field).getValues().get(0).toString(), equalTo("value1")); assertThat(getResponse.getField(field).getValues().get(1).toString(), equalTo("value2")); - client().admin().indices().prepareFlush("my-index").get(); + FlushResponse flushResponse = client().admin().indices().prepareFlush("my-index").get(); + assertNoFailures(flushResponse); + assertAllSuccessful(flushResponse); getResponse = client().prepareGet("my-index", "my-type1", "1").setFields(field).get(); assertThat(getResponse.isExists(), equalTo(true));