| | |
| | | } |
| | | |
| | | @Test |
| | | void readsFinalPersistedTablesWhenAvailableAndReturnsEpochMillis() |
| | | { |
| | | when(tests.selectTestById(11L)).thenReturn(new TTest()); |
| | | Map<String, Object> row = row("recordNo", "RT-1", "deviceTime", java.util.Date.from(Instant.parse("2026-09-02T00:00:00Z")), |
| | | "serverReceivedAt", java.util.Date.from(Instant.parse("2026-09-02T00:00:01Z"))); |
| | | when(mapper.selectPersistedFinalRealtimeRecords(11L)).thenReturn(List.of(row)); |
| | | when(mapper.selectDataOverrides(11L, "REALTIME")).thenReturn(List.of()); |
| | | |
| | | Map<String, Object> actual = new TestDataQueryServiceImpl(mapper, tests).records(11L).get(0); |
| | | |
| | | assertEquals(Instant.parse("2026-09-02T00:00:00Z").toEpochMilli(), actual.get("deviceTime")); |
| | | assertEquals(Instant.parse("2026-09-02T00:00:01Z").toEpochMilli(), actual.get("serverReceivedAt")); |
| | | } |
| | | |
| | | @Test |
| | | void assignsCollectorObservationToCabinetStepByDeviceTime() |
| | | { |
| | | when(tests.selectTestById(9L)).thenReturn(new TTest()); |