mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add method
This commit is contained in:
@@ -14,7 +14,7 @@ public class CronPatternNextMatchTest {
|
||||
public void nextMatchAllAfterTest() {
|
||||
// 匹配所有,返回下一秒的时间
|
||||
CronPattern pattern = new CronPattern("* * * * * * *");
|
||||
DateTime date = DateUtil.truncate(DateUtil.date(), DateField.SECOND);
|
||||
DateTime date = DateUtil.truncate(DateUtil.now(), DateField.SECOND);
|
||||
Calendar calendar = pattern.nextMatchAfter(date.toCalendar());
|
||||
Assert.assertEquals(date.getTime(), DateUtil.date(calendar).getTime());
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public class CronPatternTest {
|
||||
pattern = CronPattern.of("* * * * *");
|
||||
|
||||
// 测试时,秒归零,则任意时间匹配
|
||||
assertMatch(pattern, DateUtil.beginOfMinute(DateUtil.date()).toString());
|
||||
assertMatch(pattern, DateUtil.beginOfMinute(DateUtil.now()).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user