Skip to content

Commit 683a388

Browse files
committed
fix tests
1 parent a3bd3cb commit 683a388

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/SetUpgradeModeActionResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public SetUpgradeModeActionResponse(StreamInput in) throws IOException {
2323
this.alreadyInUpgradeMode = in.getTransportVersion().onOrAfter(ML_TRANSFORM_SYSTEM_INDEX_MIGRATE_REASON) && in.readBoolean();
2424
}
2525

26-
public SetUpgradeModeActionResponse(boolean acknowledged, boolean modified) {
26+
public SetUpgradeModeActionResponse(boolean acknowledged, boolean alreadyInUpgradeMode) {
2727
super(acknowledged);
28-
this.alreadyInUpgradeMode = modified;
28+
this.alreadyInUpgradeMode = alreadyInUpgradeMode;
2929
}
3030

3131
@Override

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/AbstractTransportSetUpgradeModeActionTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.function.Consumer;
2727

2828
import static org.hamcrest.Matchers.containsString;
29+
import static org.hamcrest.Matchers.equalTo;
2930
import static org.hamcrest.Matchers.instanceOf;
3031
import static org.hamcrest.Matchers.is;
3132
import static org.hamcrest.Matchers.not;
@@ -108,7 +109,7 @@ public void testUpdateDoesNotRun() throws Exception {
108109

109110
var response = action.run(true);
110111

111-
assertThat(response.v1(), is(AcknowledgedResponse.TRUE));
112+
assertThat(response.v1(), equalTo(new SetUpgradeModeActionResponse(true, true)));
112113
assertThat(response.v2(), nullValue());
113114
assertThat(shouldNotChange.get(), is(true));
114115
}
@@ -150,7 +151,7 @@ public void testSuccess() throws Exception {
150151

151152
var response = action.run(true);
152153

153-
assertThat(response.v1(), is(AcknowledgedResponse.TRUE));
154+
assertThat(response.v1(), equalTo(new SetUpgradeModeActionResponse(true, false)));
154155
assertThat(response.v2(), nullValue());
155156
}
156157

@@ -177,8 +178,8 @@ public void runWithoutWaiting(boolean upgrade) throws Exception {
177178
masterOperation(mock(), new SetUpgradeModeActionRequest(upgrade), ClusterState.EMPTY_STATE, ActionListener.noop());
178179
}
179180

180-
public Tuple<AcknowledgedResponse, Exception> run(boolean upgrade) throws Exception {
181-
AtomicReference<Tuple<AcknowledgedResponse, Exception>> response = new AtomicReference<>();
181+
public Tuple<SetUpgradeModeActionResponse, Exception> run(boolean upgrade) throws Exception {
182+
AtomicReference<Tuple<SetUpgradeModeActionResponse, Exception>> response = new AtomicReference<>();
182183
CountDownLatch latch = new CountDownLatch(1);
183184
masterOperation(mock(), new SetUpgradeModeActionRequest(upgrade), ClusterState.EMPTY_STATE, ActionListener.wrap(r -> {
184185
response.set(Tuple.tuple(r, null));

0 commit comments

Comments
 (0)