mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 15:17:30 -04:00
Use assertAcked more (#101201)
Just found that we have a lot of inconsistency and needless verbosity here in tests. We can just use `assertAcked` in a couple spots to save `.get`, `.actionGet` etc., especially with the signature change I added here.
This commit is contained in:
parent
84afa5cee3
commit
3945ee75d0
100 changed files with 130 additions and 343 deletions
|
@ -19,7 +19,6 @@ import org.apache.lucene.tests.util.TimeUnits;
|
|||
import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.LatchedActionListener;
|
||||
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
|
||||
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
|
||||
import org.elasticsearch.action.bulk.BulkProcessor2;
|
||||
import org.elasticsearch.action.bulk.BulkRequest;
|
||||
|
@ -187,8 +186,7 @@ public class CCSDuelIT extends ESRestTestCase {
|
|||
IndexResponse indexResponse = restHighLevelClient.index(indexRequest, RequestOptions.DEFAULT);
|
||||
assertEquals(201, indexResponse.status().getStatus());
|
||||
|
||||
CreateIndexResponse response = createIndex(INDEX_NAME + "_empty");
|
||||
assertTrue(response.isAcknowledged());
|
||||
ElasticsearchAssertions.assertAcked(createIndex(INDEX_NAME + "_empty"));
|
||||
|
||||
int numShards = randomIntBetween(1, 5);
|
||||
Settings settings = indexSettings(numShards, 0).build();
|
||||
|
@ -209,8 +207,7 @@ public class CCSDuelIT extends ESRestTestCase {
|
|||
}
|
||||
}
|
||||
}""";
|
||||
response = createIndex(INDEX_NAME, settings, mapping);
|
||||
assertTrue(response.isAcknowledged());
|
||||
ElasticsearchAssertions.assertAcked(createIndex(INDEX_NAME, settings, mapping));
|
||||
|
||||
BulkProcessor2 bulkProcessor = BulkProcessor2.builder(
|
||||
(r, l) -> restHighLevelClient.bulkAsync(r, RequestOptions.DEFAULT, l),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue