[TEST] random aliases were never created in createRandomIndicesWithAliases

missing `.get()` :)  the create index request was never sent. The indices were being automatically created when indexing a document into them.

Original commit: elastic/x-pack-elasticsearch@129d69c88e
This commit is contained in:
javanna 2016-10-17 12:22:24 +02:00 committed by Luca Cavanna
parent 21af0d5dc7
commit 3e5833e85c
1 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout;
import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
import static org.hamcrest.Matchers.is;
@ -371,12 +372,13 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
if (randomBoolean()) {
//one alias per index with suffix "-alias"
for (String index : indices) {
client().admin().indices().prepareCreate(index).setSettings(indexSettings()).addAlias(new Alias(index + "-alias"));
assertAcked(client().admin().indices().prepareCreate(index).setSettings(indexSettings())
.addAlias(new Alias(index + "-alias")));
}
} else {
//same alias pointing to all indices
for (String index : indices) {
client().admin().indices().prepareCreate(index).setSettings(indexSettings()).addAlias(new Alias("alias"));
assertAcked(client().admin().indices().prepareCreate(index).setSettings(indexSettings()).addAlias(new Alias("alias")));
}
}
}