yeg
2026-09-05 27428b31edee97703b529559146cdd7eef87a7a9
ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TestDataQueryServiceEffectiveDataTest.java
@@ -67,6 +67,21 @@
    }
    @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());