@Test
public void shouldNotFailWhenMissingResourceIdsWhenTransitionFromPrepareToError()
    throws Exception {

  Optional<RunState> runState = Optional.of(
      RunState.create(INSTANCE, State.PREPARE, StateData.zero(), NOW, 17));
  when(transaction.readActiveState(INSTANCE)).thenReturn(runState);
  Event event = Event.halt(INSTANCE);
  stateManager.receive(event);
  verify(transaction).deleteActiveState(INSTANCE);
  verify(storage).writeEvent(SequenceEvent.create(event, 18, NOW.toEpochMilli()));
}