@Test
public void getSchedulerStatusTest() {

    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.STOPPED);
    final SchedulerStatus schedulerStatus = this.schedulerService.getSchedulerStatus(beanName);
    assertThat(schedulerStatus).isEqualTo(SchedulerStatus.STOPPED);
}