@Test
  public void testGetWorkflowsForEvent() throws RepositoryException {
    DataSourceWorkflowRepository repo = new DataSourceWorkflowRepository(ds);
    List<Workflow> workflow = repo.getWorkflowsForEvent("event");

    assertThat(workflow, allOf(notNullValue(), hasSize(1)));

    assertThat(workflow.get(0).getName(), equalTo("Test Workflow"));
  }
  @Test(expected = RepositoryException.class)
  public void testGetWorkflowsForEventNoDataSource() throws RepositoryException {

    DataSourceWorkflowRepository repo = new DataSourceWorkflowRepository(null);
    List<Workflow> workflow = repo.getWorkflowsForEvent("event", false, false);

    assertThat(workflow, allOf(notNullValue(), hasSize(2)));

    assertThat(workflow.get(0).getPreConditions(), allOf(notNullValue(), hasSize(0)));
    assertThat(workflow.get(0).getPostConditions(), allOf(notNullValue(), hasSize(0)));
  }
  @Test
  public void testGetworkflowsForEventNoTasksOrConditions() throws RepositoryException {

    DataSourceWorkflowRepository repo = new DataSourceWorkflowRepository(ds);
    List<Workflow> workflow = repo.getWorkflowsForEvent("event", false, false);

    assertThat(workflow, allOf(notNullValue(), hasSize(1)));

    assertThat(workflow.get(0).getPreConditions(), allOf(notNullValue(), hasSize(0)));
    assertThat(workflow.get(0).getPostConditions(), allOf(notNullValue(), hasSize(0)));
  }