### Question:
DefaultSchedulerService implements InitializingBean, SchedulerService { public String addCronTrigger(String id, ReportParameters criteria, DeliveryOptions deliveryOptions, String cronExpression, RequestContext context) { CronTrigger cronTrigger = null; try { if (m_reportWrapperService.validate(criteria,id) == false ) { log().error(PARAMETER_ERROR); context.getMessageContext().addMessage( new MessageBuilder().error().defaultText( PARAMETER_ERROR).build()); return ERROR; } else { try { cronTrigger = new CronTrigger(); cronTrigger.setGroup(m_triggerGroup); cronTrigger.setName(deliveryOptions.getInstanceId()); cronTrigger.setJobName(m_jobDetail.getName()); cronTrigger.setCronExpression(cronExpression); } catch (ParseException e) { log().error(TRIGGER_PARSE_ERROR, e); context.getMessageContext().addMessage( new MessageBuilder().error().defaultText( TRIGGER_PARSE_ERROR).build()); return ERROR; } cronTrigger.setJobName(m_jobDetail.getName()); cronTrigger.getJobDataMap().put("criteria", (ReportParameters) criteria); cronTrigger.getJobDataMap().put("reportId", id); cronTrigger.getJobDataMap().put("mode", ReportMode.SCHEDULED); cronTrigger.getJobDataMap().put("deliveryOptions", (DeliveryOptions) deliveryOptions); try { m_scheduler.scheduleJob(cronTrigger); } catch (SchedulerException e) { log().error(SCHEDULER_ERROR, e); context.getMessageContext().addMessage( new MessageBuilder().error().defaultText( SCHEDULER_ERROR).build()); return ERROR; } return SUCCESS; } } catch (ReportServiceLocatorException e) { log().error(REPORTID_ERROR); context.getMessageContext().addMessage( new MessageBuilder().error().defaultText( REPORTID_ERROR).build()); return ERROR; } }  @Override void afterPropertiesSet(); List<TriggerDescription> getTriggerDescriptions(); Boolean exists(String triggerName); void removeTrigger(String triggerName); void removeTriggers(String[] triggerNames); String addCronTrigger(String id, ReportParameters criteria,
            DeliveryOptions deliveryOptions,
            String cronExpression, RequestContext context); String execute(String id, ReportParameters criteria,
            DeliveryOptions deliveryOptions, RequestContext context); void setScheduler(Scheduler scheduler); void setJobDetail(JobDetail reportJob); void setTriggerGroup(String triggerGroup); void setReportWrapperService(ReportWrapperService reportWrapperService);  }### Answer:
@Test public void testScheduleBadCronExpression() { expect(m_reportWrapperService.validate(m_criteria, REPORT_ID)).andReturn(true); replay(m_reportWrapperService); MockRequestContext context = new MockRequestContext(); DeliveryOptions deliveryOptions = new DeliveryOptions(); deliveryOptions.setInstanceId("testScheduleBadCronExpressionTrigger"); assertEquals("error", m_schedulerService.addCronTrigger(REPORT_ID, m_criteria, deliveryOptions, "bad expression", context)); verify(m_reportWrapperService); }