Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed LocalDateXX -> epochMilli tests #98

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class ConverterEverythingTest {
private static final TimeZone TOKYO_TZ = TimeZone.getTimeZone(TOKYO_Z);
private Converter converter;
private final ConverterOptions options = new ConverterOptions() {
public TimeZone getTimeZone() {
return TOKYO_TZ;
public ZoneId getZoneId() {
return TOKYO_Z;
}
};
private static final Map<Map.Entry<Class<?>, Class<?>>, Object[][]> TEST_DB = new ConcurrentHashMap<>(500, .8f);
Expand Down Expand Up @@ -803,14 +803,14 @@ public TimeZone getTimeZone() {
ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00");
zdt = zdt.withZoneSameInstant(TOKYO_Z);
return zdt.toLocalDate();
}, 1707714000000L }, // Epoch millis in Tokyo timezone (at start of day - no time)
}, 1707663600000L }, // Epoch millis in Tokyo timezone (at start of day - no time)
});
TEST_DB.put(pair(LocalDateTime.class, Long.class), new Object[][] {
{ (Supplier<LocalDateTime>) () -> {
ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00");
zdt = zdt.withZoneSameInstant(TOKYO_Z);
return zdt.toLocalDateTime();
}, 1707784680000L }, // Epoch millis in Tokyo timezone
}, 1707734280000L }, // Epoch millis in Tokyo timezone
});
TEST_DB.put(pair(ZonedDateTime.class, Long.class), new Object[][] {
{ ZonedDateTime.parse("2024-02-12T11:38:00+01:00"), 1707734280000L },
Expand Down Expand Up @@ -1054,14 +1054,14 @@ public TimeZone getTimeZone() {
ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00");
zdt = zdt.withZoneSameInstant(TOKYO_Z);
return zdt.toLocalDate();
}, 1.707714E12d }, // Epoch millis in Tokyo timezone (at start of day - no time)
}, 1.7076636E12 }, // Epoch millis in Tokyo timezone (at start of day - no time)
});
TEST_DB.put(pair(LocalDateTime.class, Double.class), new Object[][] {
{ (Supplier<LocalDateTime>) () -> {
ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00");
zdt = zdt.withZoneSameInstant(TOKYO_Z);
return zdt.toLocalDateTime();
}, 1.70778468E12d }, // Epoch millis in Tokyo timezone
}, 1.70773428E12 }, // Epoch millis in Tokyo timezone
});
TEST_DB.put(pair(ZonedDateTime.class, Double.class), new Object[][] {
{ ZonedDateTime.parse("2024-02-12T11:38:00+01:00"), 1707734280000d },
Expand Down
Loading