@Test
public void scheduleTest() {

    final String beanName = "schedulerBean";
    when(this.applicationContext.containsBean(beanName)).thenReturn(Boolean.TRUE);
    when(this.applicationContext.getBean(beanName, Scheduler.class)).thenReturn(this.scheduler);
    when(this.scheduler.getSchedulerStatus()).thenReturn(SchedulerStatus.INITIALIZED);
    this.schedulerService.schedule(beanName, Boolean.FALSE);
    verify(this.scheduler, times(1)).schedule();
}