mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -100,6 +100,18 @@ public class CronPatternNextMatchTest {
|
||||
Assertions.assertEquals("2022-01-12 00:12:23", DateUtil.date(calendar).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nextMatchAfterTest2(){
|
||||
final CronPattern pattern = new CronPattern("23 12 * 12 * * *");
|
||||
|
||||
// 秒超出规定值的最大值,分不变,小时+1,秒和分使用最小值
|
||||
//noinspection ConstantConditions
|
||||
final Calendar calendar = pattern.nextMatchAfter(
|
||||
DateUtil.parse("2022-04-12 09:12:24").toCalendar());
|
||||
Assertions.assertTrue(pattern.match(calendar, true));
|
||||
Assertions.assertEquals("2022-04-12 10:12:23", DateUtil.date(calendar).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nextMatchAfterByWeekTest(){
|
||||
final CronPattern pattern = new CronPattern("1 1 1 * * Sat *");
|
||||
|
@@ -14,7 +14,6 @@ package org.dromara.hutool.cron.pattern;
|
||||
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
Reference in New Issue
Block a user