JobSchedulerConfiguration extends AbstractConfiguration { void validatePeriod() { if (this.fixedDelay == null) { this.throwExceptionAndLogError("fixedDelay must not be null for PERIOD Scheduler"); } else { if (this.fixedDelay <= 0) { this.throwExceptionAndLogError("fixedDelay must not be lower then 1"); } } if (this.initialDelay != null && this.initialDelay <= 0) { this.throwExceptionAndLogError("initialDelay must not be lower then 1"); } if (this.cronExpression != null) { this.throwExceptionAndLogError("cronExpression must not be set for PERIOD Scheduler"); } }    }
@Test public void validatePeriodTest() { final JobSchedulerConfiguration jobSchedulerConfiguration = new JobSchedulerConfiguration(); jobSchedulerConfiguration.setFixedDelay(1000L); jobSchedulerConfiguration.setInitialDelay(1000L); try { jobSchedulerConfiguration.validatePeriod(); } catch (final SpringBatchLightminApplicationException e) { fail(e.getMessage()); } }