Skip to content

Commit fcf570f

Browse files
author
Christoph Büscher
authored
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.
1 parent 0130139 commit fcf570f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected ClusterHealthResponse doParseInstance(XContentParser parser) {
113113
protected ClusterHealthResponse createTestInstance() {
114114
int indicesSize = randomInt(20);
115115
Map<String, ClusterIndexHealth> indices = new HashMap<>(indicesSize);
116-
if ("indices".equals(level) || "shards".equals(level)) {
116+
if (ClusterHealthRequest.Level.INDICES.equals(level) || ClusterHealthRequest.Level.SHARDS.equals(level)) {
117117
for (int i = 0; i < indicesSize; i++) {
118118
String indexName = randomAlphaOfLengthBetween(1, 5) + i;
119119
indices.put(indexName, ClusterIndexHealthTests.randomIndexHealth(indexName, level));

0 commit comments

Comments
 (0)