### Question:
ScheduleServiceImpl implements ScheduleService { @Override public boolean pauseJob(JobKey jobKey) { log.debug("[schedulerdebug] pausing job with jobKey : {}", jobKey); try { jobHistoryService.pauseJob(jobKey); schedulerFactoryBean.getScheduler().pauseJob(jobKey); return true; } catch (SchedulerException e) { log.error("[schedulerdebug] error occurred while deleting job with jobKey : {}", jobKey, e); } return false; }  @Override boolean addJob(JobRequest jobRequest, Class<? extends Job> jobClass); @Override boolean deleteJob(JobKey jobKey); @Override boolean updateJob(JobRequest jobRequest); @Override boolean pauseJob(JobKey jobKey); @Override boolean resumeJob(JobKey jobKey); @Override boolean stopJob(JobKey jobKey); @Override StatusResponse getAllJobs(); @Override boolean isJobRunning(JobKey jobKey); @Override boolean isJobExists(JobKey jobKey); @Override String getJobState(JobKey jobKey);  }### Answer:
@Test public void pauseJob() throws SchedulerException { JobKey jobKey = new JobKey(testJobName, testGroupName); JobStatus jobStatus = new JobStatus(); when(jobHistoryService.pauseJob(jobKey)).thenReturn(jobStatus); when(schedulerFactoryBean.getScheduler()).thenReturn(scheduler); doNothing().when(scheduler).pauseJob(jobKey); boolean result = scheduleService.pauseJob(jobKey); assertThat(result).isTrue(); verify(jobHistoryService).pauseJob(jobKey); verify(schedulerFactoryBean).getScheduler(); verify(scheduler).pauseJob(jobKey); }