@Test void unschedule() throws SchedulerException { String id = "id"; when(dataService.findOneById(SCHEDULED_JOB, id, ScheduledJob.class)).thenReturn(scheduledJob); jobScheduler.unschedule(id); verify(quartzScheduler).deleteJob((jobKey)); }
synchronized void unschedule(String scheduledJobId) { try { quartzScheduler.deleteJob(new JobKey(scheduledJobId, SCHEDULED_JOB_GROUP)); } catch (SchedulerException e) { String message = format("Error deleting ScheduledJob ''{0}''", scheduledJobId); LOG.error(message, e); throw new ScheduledJobException(message, e); } }
JobScheduler { synchronized void unschedule(String scheduledJobId) { try { quartzScheduler.deleteJob(new JobKey(scheduledJobId, SCHEDULED_JOB_GROUP)); } catch (SchedulerException e) { String message = format("Error deleting ScheduledJob ''{0}''", scheduledJobId); LOG.error(message, e); throw new ScheduledJobException(message, e); } } }
JobScheduler { synchronized void unschedule(String scheduledJobId) { try { quartzScheduler.deleteJob(new JobKey(scheduledJobId, SCHEDULED_JOB_GROUP)); } catch (SchedulerException e) { String message = format("Error deleting ScheduledJob ''{0}''", scheduledJobId); LOG.error(message, e); throw new ScheduledJobException(message, e); } } JobScheduler(Scheduler quartzScheduler, DataService dataService); }
JobScheduler { synchronized void unschedule(String scheduledJobId) { try { quartzScheduler.deleteJob(new JobKey(scheduledJobId, SCHEDULED_JOB_GROUP)); } catch (SchedulerException e) { String message = format("Error deleting ScheduledJob ''{0}''", scheduledJobId); LOG.error(message, e); throw new ScheduledJobException(message, e); } } JobScheduler(Scheduler quartzScheduler, DataService dataService); synchronized void runNow(String scheduledJobId); synchronized void schedule(ScheduledJob scheduledJob); void scheduleJobs(); }
JobScheduler { synchronized void unschedule(String scheduledJobId) { try { quartzScheduler.deleteJob(new JobKey(scheduledJobId, SCHEDULED_JOB_GROUP)); } catch (SchedulerException e) { String message = format("Error deleting ScheduledJob ''{0}''", scheduledJobId); LOG.error(message, e); throw new ScheduledJobException(message, e); } } JobScheduler(Scheduler quartzScheduler, DataService dataService); synchronized void runNow(String scheduledJobId); synchronized void schedule(ScheduledJob scheduledJob); void scheduleJobs();  }