@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()); }
public void schedule(DBStack dbStack) { if (autoSyncConfig.isEnabled()) { jobService.schedule(new DBStackJobAdapter(dbStack)); LOGGER.info("{} is scheduled for auto sync", dbStack.getName()); } }
DBStackJobService { public void schedule(DBStack dbStack) { if (autoSyncConfig.isEnabled()) { jobService.schedule(new DBStackJobAdapter(dbStack)); LOGGER.info("{} is scheduled for auto sync", dbStack.getName()); } } }
DBStackJobService { public void schedule(DBStack dbStack) { if (autoSyncConfig.isEnabled()) { jobService.schedule(new DBStackJobAdapter(dbStack)); LOGGER.info("{} is scheduled for auto sync", dbStack.getName()); } }  }
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); }
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);  }