@Test
public void shouldFailTriggerIfWorkflowNotFound() throws Exception {

  when(storage.getLatestStoredCounter(any())).thenReturn(Optional.empty());
  when(transaction.workflow(INSTANCE.workflowId())).thenReturn(Optional.empty());
  exception.expect(instanceOf(IllegalArgumentException.class));
  exception.expectMessage("Workflow not found: " + INSTANCE.workflowId().toKey());
  stateManager.trigger(INSTANCE, TRIGGER1, PARAMETERS);
}