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