@Test
public void stopJobConfigurationListenerTest() throws NoSuchJobConfigurationException {

    final Long jobConfigurationId = 1L;
    when(this.properties.getApplicationName()).thenReturn(APPLICATION_NAME);
    final String beanName = "schedulerBean";
    final JobListenerConfiguration jobListenerConfiguration = DomainTestHelper.createJobListenerConfiguration
            ("src/test/", "*.txt", JobListenerType.LOCAL_FOLDER_LISTENER);
    jobListenerConfiguration.setBeanName(beanName);
    final JobConfiguration jobConfiguration = DomainTestHelper.createJobConfiguration(jobListenerConfiguration);
    jobListenerConfiguration.setBeanName(beanName);
    when(this.jobConfigurationRepository.getJobConfiguration(jobConfigurationId, APPLICATION_NAME)).thenReturn(jobConfiguration);
    this.defaultAdminService.stopJobConfiguration(jobConfigurationId);
    verify(this.listenerService, times(1)).terminateListener(beanName);
}