Fix state action tests

- Tests should now be more reliable as trying to
  make sure actions run before testing further.
- Fixes #257
This commit is contained in:
Janne Valkealahti
2016-09-25 11:20:20 +01:00
parent 49bae38eb3
commit 9c20ddd051
3 changed files with 8 additions and 5 deletions

View File

@@ -671,11 +671,11 @@ public class UmlStateMachineModelFactoryTests extends AbstractUmlTests {
LatchAction e2Action = context.getBean("e2Action", LatchAction.class);
stateMachine.start();
assertThat(stateMachine.getState().getIds(), containsInAnyOrder("S1"));
stateMachine.sendEvent("E1");
assertThat(e1Action.latch.await(1, TimeUnit.SECONDS), is(true));
stateMachine.sendEvent("E1");
assertThat(stateMachine.getState().getIds(), containsInAnyOrder("S2"));
stateMachine.sendEvent("E2");
assertThat(e2Action.latch.await(1, TimeUnit.SECONDS), is(true));
stateMachine.sendEvent("E2");
assertThat(stateMachine.getState().getIds(), containsInAnyOrder("S3"));
}