Fix ClusterHealthResponsesTests condition (#49360)
Currently the condtion that is supposed to test creation of test instances with multiple indices is never true because it compares Strings with an enum. This changes it so the condition uses the enum constants instead.
This commit is contained in:
parent
779b4bd92b
commit
138d16ab9e
|
@ -113,7 +113,7 @@ public class ClusterHealthResponsesTests extends AbstractSerializingTestCase<Clu
|
|||
protected ClusterHealthResponse createTestInstance() {
|
||||
int indicesSize = randomInt(20);
|
||||
Map<String, ClusterIndexHealth> indices = new HashMap<>(indicesSize);
|
||||
if ("indices".equals(level) || "shards".equals(level)) {
|
||||
if (ClusterHealthRequest.Level.INDICES.equals(level) || ClusterHealthRequest.Level.SHARDS.equals(level)) {
|
||||
for (int i = 0; i < indicesSize; i++) {
|
||||
String indexName = randomAlphaOfLengthBetween(1, 5) + i;
|
||||
indices.put(indexName, ClusterIndexHealthTests.randomIndexHealth(indexName, level));
|
||||
|
|
Loading…
Reference in New Issue