### Question:
ScheduleServiceImpl implements ScheduleService { @Override public boolean addJob(JobRequest jobRequest, Class<? extends Job> jobClass) { JobKey jobKey = null; JobDetail jobDetail; Trigger trigger; try { trigger = JobUtils.createTrigger(jobRequest); jobDetail = JobUtils.createJob(jobRequest, jobClass, context); jobKey = JobKey.jobKey(jobRequest.getJobName(), jobRequest.getJobGroup()); Date dt = schedulerFactoryBean.getScheduler().scheduleJob(jobDetail, trigger); log.debug("Job with jobKey : {} scheduled successfully at date : {}", jobDetail.getKey(), dt); return true; } catch (SchedulerException e) { log.error("error occurred while scheduling with 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 addJob() { JobRequest jobRequest = new JobRequest(); jobRequest.setCronExpression("0/10 * * ? * *"); jobRequest.setJobName(jobName); jobRequest.setJobGroup(groupName); when(schedulerFactoryBean.getScheduler()).thenReturn(scheduler); boolean result = scheduleService.addJob(jobRequest, CronJob.class); assertThat(result).isTrue(); verify(schedulerFactoryBean).getScheduler(); }