Skip to content

Commit

Permalink
Fix UpdateInfo test
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Jul 30, 2024
1 parent e83d23b commit be38203
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testUpdateInfo() throws ExecutionException, InterruptedException {
// return.
WorkflowExecution execution = WorkflowClient.start(workflow::execute);
WorkflowStub stub = WorkflowStub.fromTyped(workflow);
UpdateOptions.Builder updateOptionsBuilder =
UpdateOptions.Builder<String> updateOptionsBuilder =
UpdateOptions.newBuilder(String.class)
.setUpdateName("update")
.setWaitForStage(WorkflowUpdateStage.COMPLETED);
Expand All @@ -71,7 +71,9 @@ public void testUpdateInfo() throws ExecutionException, InterruptedException {

Assert.assertThrows(
WorkflowUpdateException.class,
() -> stub.startUpdate(updateOptionsBuilder.setUpdateId("reject").build(), 0, ""));
() ->
stub.startUpdate(updateOptionsBuilder.setUpdateId("reject").build(), 0, "")
.getResultAsync());

workflow.complete();
String result =
Expand Down Expand Up @@ -112,7 +114,7 @@ public String update(Integer index, String value) {
@Override
public void updateValidator(Integer index, String value) {
UpdateInfo updateInfo = Workflow.getCurrentUpdateInfo().get();
if (updateInfo.getUpdateId() == "reject") {
if (updateInfo.getUpdateId().equals("reject")) {
throw new RuntimeException("Rejecting update");
}
}
Expand Down

0 comments on commit be38203

Please sign in to comment.