Skip to content

Commit e87058d

Browse files
Fix David Turner comments
1 parent bc11bdd commit e87058d

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.allocation_explain/10_basic.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -815,19 +815,25 @@
815815

816816
- do:
817817
indices.create:
818-
index: test
818+
index: "0"
819819

820820
- match: { acknowledged: true }
821821

822822
- do:
823-
catch: /index_not_found_exception/
824823
cluster.allocation_explain:
825824
index: 0
826825
shard: 0
827826
primary: true
828-
include_disk_info: true
829-
include_yes_decisions: true
830-
master_timeout: 0
827+
828+
- match: { current_state: "started" }
829+
- is_true: current_node.id
830+
- match: { index: "0" }
831+
- match: { shard: 0 }
832+
- match: { primary: true }
833+
- is_true: can_remain_on_current_node
834+
- is_true: can_rebalance_cluster
835+
- is_true: can_rebalance_to_other_node
836+
- is_true: rebalance_explanation
831837

832838
---
833839
"cluster shard allocation explanation test with incorrect index parameter passed in URL":
@@ -851,9 +857,6 @@
851857
index: "test2"
852858
shard: 0
853859
primary: true
854-
include_disk_info: true
855-
include_yes_decisions: true
856-
master_timeout: 0
857860

858861
---
859862
"cluster shard allocation explanation test with an invalid, string shard parameter passed in URL":
@@ -1055,5 +1058,5 @@
10551058
cluster.allocation_explain:
10561059
index: "test"
10571060
shard: 0
1058-
primary: 0
1061+
primary: true
10591062
current_node: 1

server/src/test/java/org/elasticsearch/rest/RestRequestTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ public void testParamAsIntWithIntegerParameter() {
136136
assertEquals(123, value);
137137
}
138138

139-
public void testParamAsIntWithoutIntegerParameter() {
139+
public void testParamAsIntWithNonIntegerParameter() {
140140
String parameterKey = randomIdentifier();
141141
RestRequest restRequest = contentRestRequest("", singletonMap(parameterKey, "123T"));
142142
int defaultValue = randomInt();
143143

144-
assertThrows(IllegalArgumentException.class, () -> { restRequest.paramAsInt(parameterKey, defaultValue); });
144+
assertThrows(IllegalArgumentException.class, () -> restRequest.paramAsInt(parameterKey, defaultValue));
145145
}
146146

147147
public void testParamAsIntegerWithNoParameters() {
@@ -162,12 +162,12 @@ public void testParamAsIntegerWithIntegerParameter() {
162162
assertEquals(123, value2.intValue());
163163
}
164164

165-
public void testParamAsIntegerWithoutIntegerParameter() {
165+
public void testParamAsIntegerWithNonIntegerParameter() {
166166
String parameterKey = randomIdentifier();
167167
RestRequest restRequest = contentRestRequest("", singletonMap(parameterKey, "123T"));
168168
int defaultValue = randomInt();
169169

170-
assertThrows(IllegalArgumentException.class, () -> { restRequest.paramAsInteger(parameterKey, defaultValue); });
170+
assertThrows(IllegalArgumentException.class, () -> restRequest.paramAsInteger(parameterKey, defaultValue));
171171
}
172172

173173
public void testContentOrSourceParam() throws IOException {

0 commit comments

Comments
 (0)