This commit is contained in:
Looly
2023-03-31 22:13:06 +08:00
parent 3c33ab7fc2
commit 470e5415f0
2 changed files with 14 additions and 0 deletions

View File

@@ -31,4 +31,12 @@ public class ZodiacTest {
Assertions.assertNull(Zodiac.getChineseZodiac(1899));
Assertions.assertNull(Zodiac.getChineseZodiac((Calendar) null));
}
@Test
public void getZodiacOutOfRangeTest() {
// https://github.com/dromara/hutool/issues/3036
Assertions.assertThrows(IllegalArgumentException.class, ()->{
DateUtil.getZodiac(Month.UNDECIMBER.getValue(), 10);
});
}
}