refactor(core): consolidate epoch-millisecond conversions (#7161)

This commit is contained in:
Jimmy Liu Jia authored and GitHub committed 2026-10-31 21:59:50 -04:00
1 parent 94d7b2c031
commit d4f87659a7
28 files changed
+107 -91

No files matched your search

@@ -20,6 +20,13 @@ class EpochSecondsTest {
assertEquals(-0.001, EpochSeconds.fromInstant(Instant.ofEpochSecond(-1, 999_999_999)));
}
@Test
void convertsLongEpochMillisWithoutLosingMillisecondFraction() {
assertEquals(1_790_312_384.592, EpochSeconds.fromMillis(1_790_312_384_592L));
assertEquals(-0.001, EpochSeconds.fromMillis(-1L));
assertEquals(0.001, EpochSeconds.fromMillis(1L));
}
@Test
void retainsNullAndOverflowFailures() {
assertThrows(NullPointerException.class, () -> EpochSeconds.fromInstant(null));