use of org.motechproject.scheduler.contract.RepeatingSchedulableJob in project motech by motech.
the class SchedulableJobValidatorTest method shouldValidateRepeatingSchedulableJob.
@Test
public void shouldValidateRepeatingSchedulableJob() {
RepeatingSchedulableJob job = new RepeatingSchedulableJob(motechEvent, 10, 100, DateTime.now().plusHours(1), null, true, true, false);
SchedulableJobValidator.validateRepeatingSchedulableJob(job);
}
use of org.motechproject.scheduler.contract.RepeatingSchedulableJob in project motech by motech.
the class SchedulableJobValidatorTest method shouldThrowMotechSchedulerExceptionIfRepeatIntervalIsZero.
@Test(expected = MotechSchedulerException.class)
public void shouldThrowMotechSchedulerExceptionIfRepeatIntervalIsZero() {
RepeatingSchedulableJob job = new RepeatingSchedulableJob(motechEvent, 10, 0, DateTime.now().plusHours(1), null, true, true, false);
SchedulableJobValidator.validateRepeatingSchedulableJob(job);
}
use of org.motechproject.scheduler.contract.RepeatingSchedulableJob in project motech by motech.
the class SchedulableJobValidatorTest method shouldThrowIllegalArgumentExceptionIfStartDateIsNullInRepeatingSchedulableJob.
@Test(expected = IllegalArgumentException.class)
public void shouldThrowIllegalArgumentExceptionIfStartDateIsNullInRepeatingSchedulableJob() {
RepeatingSchedulableJob job = new RepeatingSchedulableJob(motechEvent, 10, 100, null, null, true, true, false);
SchedulableJobValidator.validateRepeatingSchedulableJob(job);
}
use of org.motechproject.scheduler.contract.RepeatingSchedulableJob in project motech by motech.
the class SchedulableJobValidatorTest method shouldThrowIllegalArgumentExceptionIfRepeatIntervalIsNull.
@Test(expected = IllegalArgumentException.class)
public void shouldThrowIllegalArgumentExceptionIfRepeatIntervalIsNull() {
RepeatingSchedulableJob job = new RepeatingSchedulableJob(motechEvent, 10, null, DateTime.now().plusHours(1), null, true, true, false);
SchedulableJobValidator.validateRepeatingSchedulableJob(job);
}
use of org.motechproject.scheduler.contract.RepeatingSchedulableJob in project motech by motech.
the class TestEventListener method shouldThrowExceptionForNullMotechEvent.
@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionForNullMotechEvent() throws SchedulerException {
Map<String, Object> params = new HashMap<>();
params.put(MotechSchedulerService.JOB_ID_KEY, "job_id");
schedulerService.scheduleRepeatingJob(new RepeatingSchedulableJob(null, DateTimeConstants.SECONDS_PER_DAY, newDateTime(2020, 7, 15, 12, 0, 0), newDateTime(2020, 7, 18, 12, 0, 0), false));
}
Aggregations