Skip to content

Commit

Permalink
restore done state method for state workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvard Fonsell committed Dec 2, 2014
1 parent 2d5063b commit 84e4f5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public NextAction state5(StateExecution execution, @StateVar(value = "variable2"
return moveToState(done, "variable2 is set to " + variable2.value);
}

public void done(StateExecution execution) {
System.out.println("StateWorkflow done.");
}

public static class Variable {
public String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ public void t02_checkStateVariables() throws InterruptedException {
assertEquals(singletonMap("value", "foo1"), listResponse.stateVariables.get("variable1"));
assertEquals(singletonMap("value", "bar3"), listResponse.stateVariables.get("variable2"));

assertEquals(5, listResponse.actions.size());
assertEquals(6, listResponse.actions.size());
assertState(listResponse.actions, 0, StateWorkflow.State.state1, "foo1", null);
assertState(listResponse.actions, 1, StateWorkflow.State.state2, null, "bar1");
assertState(listResponse.actions, 2, StateWorkflow.State.state3, null, "bar2");
assertState(listResponse.actions, 3, StateWorkflow.State.state4, null, null);
assertState(listResponse.actions, 4, StateWorkflow.State.state5, null, "bar3");
assertState(listResponse.actions, 5, StateWorkflow.State.done, null, null);
}

private void assertState(List<Action> actions, int index, State state, String variable1, String variable2) {
Expand Down

0 comments on commit 84e4f5a

Please sign in to comment.