@Test
  public void scheduleDeletedOnlyIfTaskIsActive() throws Exception {
    // given
    final ScheduledTask task =
        ReadEmailTask.newInstance() //
            .build();

    // when
    schedulerFacade.delete(task);

    // then
    final InOrder inOrder = inOrder(schedulerService, converter);
    inOrder.verifyNoMoreInteractions();
  }
  @Test
  public void scheduleDeleted() throws Exception {
    // given
    final ScheduledTask task =
        ReadEmailTask.newInstance() //
            .withActiveStatus(true) //
            .build();
    final Job job = mock(Job.class);
    final LogicAsSourceConverter logicAsSourceConverter = mock(LogicAsSourceConverter.class);
    when(logicAsSourceConverter.toJob()) //
        .thenReturn(job);
    when(converter.from(task)) //
        .thenReturn(logicAsSourceConverter);

    // when
    schedulerFacade.delete(task);

    // then
    final InOrder inOrder = inOrder(schedulerService, converter);
    inOrder.verify(converter).from(task);
    inOrder.verify(schedulerService).remove(job);
    inOrder.verifyNoMoreInteractions();
  }