@Test
public void shouldReturnTriesExecIdAndExitCode() {

  final StateData stateData = StateData.newBuilder().executionId("exec-1").build();
  assertThat(stateInfo(RunState.create(WORKFLOW_INSTANCE, TERMINATED, stateData)),
      is(format("tries:0 execId:%s exitCode:-", stateData.executionId())));
  assertThat(stateInfo(
      RunState.create(WORKFLOW_INSTANCE, TERMINATED, stateData.builder().lastExit(10).build())),
      is(format("tries:0 execId:%s exitCode:10", stateData.executionId())));
}