refactor(core): remove remaining epoch timestamp wrappers (#7167)

This commit is contained in:
Jimmy Liu Jia authored and GitHub committed 2026-11-01 07:38:24 -04:00
1 parent e90f2590b5
commit 8edbc10b71
5 files changed
+21 -30

No files matched your search

@@ -543,6 +543,7 @@ class RedshiftServerlessAdministrationHandlerTest {
assertEquals("env", created.get("targetAction").get("createSnapshot").get("tags").get(0).get("key").textValue());
assertEquals("nightly", created.get("scheduledActionDescription").textValue());
assertEquals(1, created.get("nextInvocations").size());
assertTrue(created.get("nextInvocations").get(0).isNumber());
assertTrue(created.get("scheduledActionUuid").textValue().length() > 8);
assertEquals("ConflictException", errorType("CreateScheduledAction", "{\"scheduledActionName\":\"nightly-snap\","
@@ -562,6 +563,7 @@ class RedshiftServerlessAdministrationHandlerTest {
assertEquals("DISABLED", oneOff.get("state").textValue());
assertEquals(0, oneOff.get("nextInvocations").size());
assertEquals(future, oneOff.get("schedule").get("at").longValue());
assertTrue(oneOff.get("schedule").get("at").isNumber());
assertEquals("sched-ns", oneOff.get("namespaceName").textValue());
JsonNode activeOneOff = ok("UpdateScheduledAction", "{\"scheduledActionName\":\"nightly-snap\","
@@ -576,6 +578,8 @@ class RedshiftServerlessAdministrationHandlerTest {
JsonNode beforeStart = ok("UpdateScheduledAction", "{\"scheduledActionName\":\"nightly-snap\","
+ "\"endTime\":" + (future + 1000) + ",\"startTime\":" + (future + 100) + "}").get("scheduledAction");
assertEquals(0, beforeStart.get("nextInvocations").size());
assertEquals(future + 1000, beforeStart.get("endTime").longValue());
assertEquals(future + 100, beforeStart.get("startTime").longValue());
JsonNode inWindow = ok("UpdateScheduledAction", "{\"scheduledActionName\":\"nightly-snap\","
+ "\"startTime\":" + (future - 100) + "}").get("scheduledAction");
@@ -271,17 +271,6 @@ class SesV2JsonTest {
assertAws("SerializationException", 400, () -> SesV2Json.coerceBooleanOrFalse(json("0")));
}
@Test
void epochSeconds_keepsMillisecondFraction() {
assertEquals(1_790_312_384.592, SesV2Json.epochSeconds(Instant.ofEpochMilli(1_790_312_384_592L)));
}
@Test
void epochSeconds_dropsSubMillisecondPrecision() {
assertEquals(1_790_312_384.592,
SesV2Json.epochSeconds(Instant.ofEpochSecond(1_790_312_384L, 592_999_999L)));
}
@Test
void putTimestamp_writesDecimalNumber() {
ObjectNode node = MAPPER.createObjectNode();
@@ -290,6 +279,15 @@ class SesV2JsonTest {
assertEquals("{\"CreatedTimestamp\":1.790312384592E9}", node.toString());
}
@Test
void putTimestamp_dropsSubMillisecondPrecision() {
ObjectNode node = MAPPER.createObjectNode();
SesV2Json.putTimestamp(node, "CreatedTimestamp",
Instant.ofEpochSecond(1_790_312_384L, 592_999_999L));
assertEquals(1_790_312_384.592, node.get("CreatedTimestamp").doubleValue());
}
@Test
void putTimestamp_skipsNull() {
ObjectNode node = MAPPER.createObjectNode();