org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked-s



API Populatity

2 Client projects

Project elasticsearch/elasticsearch in file ....elasticsearch.cluster.BlockClusterStatsTests.java (2014-03-21)
@@ -27,6 +27,7 @@ import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
 import org.elasticsearch.test.ElasticsearchIntegrationTest.Scope;
 import org.junit.Test;
 
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
 
@@ -53,5 +54,7 @@ public class BlockClusterStatsTests extends ElasticsearchIntegrationTest {
         ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().clear().get();
         assertThat(clusterStateResponse.getState().blocks().global(), hasSize(0));
         assertThat(clusterStateResponse.getState().blocks().indices().size(), is(0));
+        assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings(
+                ImmutableSettings.settingsBuilder().put("cluster.blocks.read_only", false).build()).get());
     }
 }
Project elasticsearch/elasticsearch in file ...rcolator.PercolatorFacetsAndAggregationsTests.java (2014-07-18)
@@ -35,6 +35,7 @@ import static org.elasticsearch.action.percolate.PercolateSourceBuilder.docBuild
 import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
 import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
 import static org.elasticsearch.index.query.QueryBuilders.matchQuery;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
 import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertMatchCount;
 import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
 import static org.hamcrest.Matchers.arrayWithSize;
@@ -48,7 +49,7 @@ public class PercolatorFacetsAndAggregationsTests extends ElasticsearchIntegrati
     @Test
     // Just test the integration with facets and aggregations, not the facet and aggregation functionality!
     public void testFacetsAndAggregations() throws Exception {
-        client().admin().indices().prepareCreate("test").execute().actionGet();
+        assertAcked(prepareCreate("test").addMapping("type", "field1", "type=string", "field2", "type=string"));
         ensureGreen();
 
         int numQueries = scaledRandomIntBetween(250, 500);
Project elasticsearch/elasticsearch in file ....index.fielddata.DisabledFieldDataFormatTests.java (2014-07-05)
@@ -34,6 +34,7 @@ import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
 
 import java.util.Set;
 
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
 import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures;
 import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
 
@@ -105,7 +106,7 @@ public class DisabledFieldDataFormatTests extends ElasticsearchIntegrationTest {
 
     private void updateFormat(final String format) throws Exception {
         logger.info(">> put mapping start {}", format);
-        client().admin().indices().preparePutMapping("test").setType("type").setSource(
+        assertAcked(client().admin().indices().preparePutMapping("test").setType("type").setSource(
                 XContentFactory.jsonBuilder().startObject().startObject("type")
                         .startObject("properties")
                             .startObject("s")
@@ -116,7 +117,7 @@ public class DisabledFieldDataFormatTests extends ElasticsearchIntegrationTest {
                             .endObject()
                         .endObject()
                         .endObject()
-                        .endObject()).execute().actionGet();
+                        .endObject()).get());
         logger.info(">> put mapping end {}", format);
         boolean applied = awaitBusy(new Predicate<Object>() {
             @Override