### Question:
DBStackJobService { public void schedule(DBStack dbStack) { if (autoSyncConfig.isEnabled()) { jobService.schedule(new DBStackJobAdapter(dbStack)); LOGGER.info("{} is scheduled for auto sync", dbStack.getName()); } }  void schedule(DBStack dbStack); void unschedule(DBStack dbStack);  }### Answer:
@Test public void shouldScheduleJobWhenEnabled() { when(autoSyncConfig.isEnabled()).thenReturn(true); victim.schedule(dbStack); ArgumentCaptor<DBStackJobAdapter> dbStackJobAdapterArgumentCaptor = ArgumentCaptor.forClass(DBStackJobAdapter.class); verify(jobService).schedule(dbStackJobAdapterArgumentCaptor.capture()); assertEquals(dbStack, dbStackJobAdapterArgumentCaptor.getValue().getResource()); }
@Test public void shouldNotScheduleJobWhenDisabled() { when(autoSyncConfig.isEnabled()).thenReturn(false); victim.schedule(dbStack); verifyZeroInteractions(jobService); }