yeg
2026-09-01 bcd53c9bf3d28de2f018dfdcff366babd8a569d2
ruoyi-device/src/test/java/com/ruoyi/device/bts/BtsDevelopmentSimulatorRecordStepCycleTest.java
@@ -53,6 +53,28 @@
    }
    @Test
    void testSnapshotKeepsCurrentStepVisibleWhenPlaybackEntersNextCycle() throws Exception
    {
        InMemoryBtsSimulatorStateStore store = new InMemoryBtsSimulatorStateStore();
        try (BtsDevelopmentSimulator simulator = new BtsDevelopmentSimulator(0, store))
        {
            simulator.updateChannel(1, 1, true, DeviceWorkStatus.WORKING);
            simulator.nextBtsCycle(1, 1);
            var snapshot = simulator.btsTest(1, 1);
            var expectedSteps = BtsExcelFixture.recordsForCycle(2).stream()
                    .map(BtsExcelFixture.FixtureRecord::stepNo).distinct().toList();
            var actualSteps = snapshot.rows().stream().filter(row -> "STEP".equals(row.rowType()))
                    .map(BtsDevelopmentSimulator.BtsTestPlanRow::stepNo).toList();
            assertEquals(expectedSteps, actualSteps);
            assertTrue(snapshot.rows().stream().anyMatch(row -> "STEP".equals(row.rowType()) && "进行中".equals(row.executionStatus())));
            assertTrue(snapshot.rows().stream().anyMatch(row -> "STEP".equals(row.rowType()) && "待执行".equals(row.executionStatus())));
            var cycleRow = snapshot.rows().stream().filter(row -> "CYCLE".equals(row.rowType())).findFirst().orElseThrow();
            assertEquals(2, cycleRow.stepNo());
            assertEquals(2, cycleRow.cycleCount());
        }
    }
    @Test
    void playbackSpeedPauseResumeAndRestartAreIndependentOfDeviceStatus() throws Exception
    {
        Instant start = Instant.parse("2026-08-31T00:00:00Z");