@Test public void shouldNotPopulateErrorsWhenTimerSpecIsValid() { timerConfig = new TimerConfig("0 0 12 * * ?", false); timerConfig.validate(null); assertThat(timerConfig.errors().isEmpty(), is(true)); }
@Test public void shouldPopulateErrorsWhenTimerSpecIsInvalid() { timerConfig = new TimerConfig("SOME JUNK TIMER SPEC", false); timerConfig.validate(null); assertThat(timerConfig.errors().firstError(), startsWith("Invalid cron syntax")); }