fix next bug

This commit is contained in:
Looly
2022-04-14 01:16:59 +08:00
parent 46594efbcc
commit 2c399fd72a
3 changed files with 28 additions and 10 deletions

View File

@@ -91,9 +91,10 @@ public class CronPatternNextMatchTest {
@Test
public void nextMatchAfterByWeekTest(){
CronPattern pattern = new CronPattern("1 1 1 * * Sat *");
// 周
final DateTime time = DateUtil.parse("2022-04-01");
// 周下个周六在4月9日
final DateTime time = DateUtil.parse("2022-04-03");
assert time != null;
final Calendar calendar = pattern.nextMatchAfter(time.toCalendar());
Assert.assertEquals("2022-04-09 01:01:01", DateUtil.date(calendar).toString());
}
}