Skip to content

Commit

Permalink
Fix ClusterHealthResponsesTests condition (#49360)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Christoph Büscher committed Nov 21, 2019
1 parent 779b4bd commit 138d16a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected ClusterHealthResponse doParseInstance(XContentParser parser) {
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));
Expand Down

0 comments on commit 138d16a

Please sign in to comment.