@Test
public void shouldHaltIfInvalidConfiguration() throws Exception {

  when(workflowValidator.validateWorkflow(any())).thenReturn(List.of("foo", "bar"));
  var workflow = Workflow.create("id", FULL_WORKFLOW_CONFIGURATION);
  var workflowState = WorkflowState.builder().enabled(true).build();
  var workflowWithState = WorkflowWithState.create(workflow, workflowState);
  var workflowInstance = WorkflowInstance.create(workflow.id(), "2016-03-14T15");
  var runState = RunState.create(workflowInstance, PREPARE, NOW, COUNTER);
  when(storage.workflowWithState(workflow.id())).thenReturn(Optional.of(workflowWithState));
  toTest.transitionInto(runState, eventRouter);
  verify(eventRouter).receiveIgnoreClosed(Event.halt(workflowInstance), COUNTER);
}