Fix CronExpression issue with DST

This commit fixes an issue with CronExpression fails to calculate next
execution on the day of daylight saving time.

Closes gh-28038
This commit is contained in:
vikey
2022-02-12 18:51:24 +08:00
committed by Arjen Poutsma
parent 685a195ba1
commit 7276752e7c
2 changed files with 15 additions and 2 deletions

View File

@@ -1336,6 +1336,14 @@ class CronExpressionTests {
actual = cronExpression.next(last);
assertThat(actual).isNotNull();
assertThat(actual).isEqualTo(expected);
cronExpression = CronExpression.parse("0 5 0 * * *");
last = ZonedDateTime.parse("2021-03-28T01:00:00+01:00[Europe/Amsterdam]");
expected = ZonedDateTime.parse("2021-03-29T00:05+02:00[Europe/Amsterdam]");
actual = cronExpression.next(last);
assertThat(actual).isNotNull();
assertThat(actual).isEqualTo(expected);
}
@Test