### Question:
ScheduleServiceImpl implements ScheduleService { @Override public boolean isJobExists(JobKey jobKey) { try { Scheduler scheduler = schedulerFactoryBean.getScheduler(); if (scheduler.checkExists(jobKey)) { return true; } } catch (SchedulerException e) { log.error("[schedulerdebug] error occurred while checking job exists :: jobKey : {}", jobKey, e); } return false; }  @Override boolean addJob(JobRequest jobRequest, Class<? extends Job> jobClass); @Override boolean deleteJob(JobKey jobKey); @Override boolean pauseJob(JobKey jobKey); @Override boolean resumeJob(JobKey jobKey); @Override JobStatusResponse getAllJobs(); @Override boolean isJobRunning(JobKey jobKey); @Override boolean isJobExists(JobKey jobKey); @Override String getJobState(JobKey jobKey);  }### Answer:
@Test public void isJobExists() throws SchedulerException { JobKey jobKey = new JobKey(jobName, groupName); when(schedulerFactoryBean.getScheduler()).thenReturn(scheduler); when(scheduler.checkExists(jobKey)).thenReturn(true); boolean result = scheduleService.isJobExists(jobKey); assertThat(result).isTrue(); verify(schedulerFactoryBean).getScheduler(); verify(scheduler).checkExists(jobKey); }