@Test(expected = IllegalArgumentException.class) public void shouldThrowIllegalArgumentExceptionIfTimeIsNull() { DayOfWeekSchedulableJob job = new DayOfWeekSchedulableJob(null, DateTime.now(), null, new ArrayList<>(), null, false, true); SchedulableJobValidator.validateDayOfWeekSchedulableJob(job); }
public static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job) { notNull(job, JOB_CANNOT_BE_NULL); notNull(job.getDays(), "List of days of week cannot be null!"); notNull(job.getTime(), "Time cannot be null!"); validateEndingSchedulableJob(job); }
SchedulableJobValidator { public static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job) { notNull(job, JOB_CANNOT_BE_NULL); notNull(job.getDays(), "List of days of week cannot be null!"); notNull(job.getTime(), "Time cannot be null!"); validateEndingSchedulableJob(job); } }
SchedulableJobValidator { public static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job) { notNull(job, JOB_CANNOT_BE_NULL); notNull(job.getDays(), "List of days of week cannot be null!"); notNull(job.getTime(), "Time cannot be null!"); validateEndingSchedulableJob(job); } private  SchedulableJobValidator(); }
SchedulableJobValidator { public static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job) { notNull(job, JOB_CANNOT_BE_NULL); notNull(job.getDays(), "List of days of week cannot be null!"); notNull(job.getTime(), "Time cannot be null!"); validateEndingSchedulableJob(job); } private  SchedulableJobValidator(); static void validateCronSchedulableJob(CronSchedulableJob job); static void validateRepeatingSchedulableJob(RepeatingSchedulableJob job); static void validateRepeatingPeriodSchedulableJob(RepeatingPeriodSchedulableJob job); static void validateRunOnceSchedulableJob(RunOnceSchedulableJob job); static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job); }
SchedulableJobValidator { public static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job) { notNull(job, JOB_CANNOT_BE_NULL); notNull(job.getDays(), "List of days of week cannot be null!"); notNull(job.getTime(), "Time cannot be null!"); validateEndingSchedulableJob(job); } private  SchedulableJobValidator(); static void validateCronSchedulableJob(CronSchedulableJob job); static void validateRepeatingSchedulableJob(RepeatingSchedulableJob job); static void validateRepeatingPeriodSchedulableJob(RepeatingPeriodSchedulableJob job); static void validateRunOnceSchedulableJob(RunOnceSchedulableJob job); static void validateDayOfWeekSchedulableJob(DayOfWeekSchedulableJob job);  }