@Test
public void testDispatchJob() throws Exception {

  DyneinJobSpec jobSpec = getTestJobSpec(validToken, "test3");
  Schedule schedule = getSchedule(jobSpec, false);
  when(asyncClient.add(schedule.getJobSpec(), "test3"))
      .thenReturn(CompletableFuture.completedFuture(null));
  CompletableFuture<Void> ret = worker.dispatchToDestination(schedule);
  ret.get(1000, TimeUnit.MILLISECONDS);
  verify(asyncClient, times(1)).add(schedule.getJobSpec(), "test3");
  verify(scheduleManager, times(1)).deleteDispatchedJob(eq(schedule));
  verifyNoMoreInteractions(asyncClient, scheduleManager);
}