yeg
2026-09-03 54f683c3fd09dd88fd4520e014b14825f7479c2f
ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TTestLiveServiceImplTest.java
@@ -59,6 +59,18 @@
        assertEquals(new BigDecimal("2.500"), snapshot.get("capacityAh"));
    }
    @Test
    void pausedShouldNotExposeUnavailableSourceAsAlarm()
    {
        Instant now = Instant.parse("2026-09-02T06:00:00Z");
        TTest test = test("PAUSED");
        TTestLiveServiceImpl service = liveService(test, now, false);
        LiveState state = service.current(10L);
        assertTrue(state.exceptions().isEmpty());
    }
    private static TTest test(String receptionStatus)
    {
        TTest test = new TTest();
@@ -81,6 +93,11 @@
    private static TTestLiveServiceImpl liveService(TTest test, Instant now)
    {
        return liveService(test, now, true);
    }
    private static TTestLiveServiceImpl liveService(TTest test, Instant now, boolean online)
    {
        DeviceDiscoveryCandidateStore candidates = mock(DeviceDiscoveryCandidateStore.class);
        BtsDevelopmentSimulator simulator = mock(BtsDevelopmentSimulator.class);
        ITTestService tests = mock(ITTestService.class);
@@ -91,7 +108,7 @@
                new BigDecimal("9.250"), 12L, 12L, "0", now,
                java.util.Map.of());
        DeviceDiscoveryCandidateStore.ChannelCandidate channel = new DeviceDiscoveryCandidateStore.ChannelCandidate(
                identity, true, DeviceWorkStatus.WORKING, now, snapshot);
                identity, online, DeviceWorkStatus.WORKING, now, snapshot);
        DeviceDiscoveryCandidateStore.CabinetCandidate cabinet = new DeviceDiscoveryCandidateStore.CabinetCandidate(
                "dev-sim", 1L, "dev-sim", 1, 1, "127.0.0.2", "mac", "cabinet", "vendor", "model",
                List.of(channel), now, now.plusSeconds(60));