Skip to content

Commit

Permalink
Add test for combination of fixed date fields
Browse files Browse the repository at this point in the history
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
  • Loading branch information
poutsma committed Aug 3, 2020
1 parent 87c3bb5 commit 72895f0
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,17 @@ void monthSequence() {
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);
}

}

0 comments on commit 72895f0

Please sign in to comment.