@SuppressWarnings("unchecked")
@Test(expected = SpringBatchLightminApplicationException.class)
public void updateJobConfigurationErrorTest() {

    final JobSchedulerConfiguration jobSchedulerConfiguration = DomainTestHelper.createJobSchedulerConfiguration(
            "0 0/5 * * * ?", null, null, JobSchedulerType.CRON);
    final JobConfiguration jobConfiguration = DomainTestHelper.createJobConfiguration(jobSchedulerConfiguration);
    jobConfiguration.setJobConfigurationId(1L);
    try {
        when(this.properties.getApplicationName()).thenReturn(APPLICATION_NAME);
        when(this.jobConfigurationRepository.getJobConfiguration(jobConfiguration.getJobConfigurationId(), APPLICATION_NAME)).thenReturn(jobConfiguration);
        when(this.jobConfigurationRepository.update(jobConfiguration, APPLICATION_NAME))
                .thenThrow(NoSuchJobConfigurationException.class);
    } catch (final NoSuchJobConfigurationException e) {
        fail(e.getMessage());
    }
    this.defaultAdminService.updateJobConfiguration(jobConfiguration);
}