@Test
public void createWorkflowInstanceWorks() {

  CreateWorkflowInstanceRequest req = new CreateWorkflowInstanceRequest();
  WorkflowInstance inst = mock(WorkflowInstance.class);
  when(createWorkflowConverter.convert(req)).thenReturn(inst);
  when(workflowInstances.insertWorkflowInstance(inst)).thenReturn(1L);
  try (Response r = resource.createWorkflowInstance(req)) {
    assertThat(r.getStatus(), is(CREATED.getStatusCode()));
    assertThat(r.getHeaderString("Location"), is("1"));
    verify(createWorkflowConverter).convert(req);
    verify(workflowInstances).insertWorkflowInstance(any(WorkflowInstance.class));
    verify(workflowInstances).getWorkflowInstance(1, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null);
  }
}