Fixes ExplainLifecycleRequestTests

This commit is contained in:
Colin Goodheart-Smithe 2018-06-13 16:15:26 +01:00
parent 9fd4f3f854
commit 43eaec304b
No known key found for this signature in database
GPG Key ID: F975E7BDD739B3C7
1 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.action.ExplainLifecycleAction.Request;
import java.io.IOException;
import java.util.Arrays;
public class ExplainLifecycleRequestTests extends AbstractWireSerializingTestCase<Request> {
@ -19,7 +20,7 @@ public class ExplainLifecycleRequestTests extends AbstractWireSerializingTestCas
protected Request createTestInstance() {
Request request = new Request();
if (randomBoolean()) {
request.indices(generateRandomStringArray(20, 20, false, false));
request.indices(generateRandomStringArray(20, 20, false, true));
}
if (randomBoolean()) {
IndicesOptions indicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean(),
@ -35,7 +36,8 @@ public class ExplainLifecycleRequestTests extends AbstractWireSerializingTestCas
IndicesOptions indicesOptions = instance.indicesOptions();
switch (between(0, 1)) {
case 0:
indices = generateRandomStringArray(20, 10, false, false);
indices = randomValueOtherThanMany(i -> Arrays.equals(i, instance.indices()),
() -> generateRandomStringArray(20, 10, false, true));
break;
case 1:
indicesOptions = randomValueOtherThan(indicesOptions, () -> IndicesOptions.fromOptions(randomBoolean(), randomBoolean(),