### Question:
SchedulerService extends BaseService { public static void deleteSchedule(int projectId, int scheduleId) { logger.info("delete schedules of project id:{}, schedule id:{}", projectId, scheduleId); String jobName = QuartzExecutors.buildJobName(scheduleId); String jobGroupName = QuartzExecutors.buildJobGroupName(projectId); if(!QuartzExecutors.getInstance().deleteJob(jobName, jobGroupName)){ logger.warn("set offline failure:projectId:{},scheduleId:{}",projectId,scheduleId); throw new ServiceException("set offline failure"); } }  @Transactional(rollbackFor = RuntimeException.class) Map<String, Object> insertSchedule(User loginUser, String projectName,
                                              Integer processDefineId,
                                              String schedule,
                                              WarningType warningType,
                                              int warningGroupId,
                                              FailureStrategy failureStrategy,
                                              String receivers,
                                              String receiversCc,
                                              Priority processInstancePriority,
                                              String workerGroup); @Transactional(rollbackFor = RuntimeException.class) Map<String, Object> updateSchedule(User loginUser,
                                              String projectName,
                                              Integer id,
                                              String scheduleExpression,
                                              WarningType warningType,
                                              int warningGroupId,
                                              FailureStrategy failureStrategy,
                                              String receivers,
                                              String receiversCc,
                                              ReleaseState scheduleStatus,
                                              Priority processInstancePriority,
                                              String workerGroup); @Transactional(rollbackFor = RuntimeException.class) Map<String, Object> setScheduleState(User loginUser,
                                                String projectName,
                                                Integer id,
                                                ReleaseState scheduleStatus); Map<String, Object> querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize); Map<String, Object> queryScheduleList(User loginUser, String projectName); void setSchedule(int projectId, Schedule schedule); static void deleteSchedule(int projectId, int scheduleId); Map<String, Object> deleteScheduleById(User loginUser, String projectName, Integer scheduleId); Map<String,Object> previewSchedule(User loginUser, String projectName, String schedule);  }### Answer:
@Test public void testDeleteSchedule() { Mockito.when(quartzExecutors.deleteJob("1", "1")).thenReturn(true); Mockito.when(quartzExecutors.buildJobGroupName(1)).thenReturn("1"); Mockito.when(quartzExecutors.buildJobName(1)).thenReturn("1"); boolean flag = true; try { schedulerService.deleteSchedule(1, 1); } catch (Exception e) { flag = false; } Assert.assertTrue(flag); }