Add test for combination of fixed date fields

Added test for a fixed day-of-week and day-of-month combination.
With the new CronExpression in place, this failure does not occur
anymore.

Closes gh-13621
This commit is contained in:
Arjen Poutsma
2020-07-24 12:37:17 +02:00
parent 87c3bb5797
commit 72895f0810

View File

@@ -431,4 +431,17 @@ class CronExpressionTests {
assertThat(expression.next(last)).isEqualTo(expected);
}
@Test
public void fixedDays() {
CronExpression expression = CronExpression.parse("0 0 0 29 2 WED");
LocalDateTime last = LocalDateTime.of(2012, 2, 29, 1, 0);
assertThat(last.getDayOfWeek()).isEqualTo(WEDNESDAY);
LocalDateTime actual = expression.next(last);
assertThat(actual).isNotNull();
assertThat(actual.getDayOfMonth()).isEqualTo(29);
assertThat(actual.getDayOfWeek()).isEqualTo(WEDNESDAY);
}
}