| | |
| | | } |
| | | |
| | | @Test |
| | | void powerCycleResetsBtsFixtureLifecycleAndClearsHistory() throws Exception |
| | | { |
| | | InMemoryBtsSimulatorStateStore store = new InMemoryBtsSimulatorStateStore(); |
| | | try (BtsDevelopmentSimulator simulator = new BtsDevelopmentSimulator(0, store)) |
| | | { |
| | | simulator.updateChannel(1, 1, true, DeviceWorkStatus.WORKING); |
| | | simulator.nextBtsCycle(1, 1); |
| | | assertEquals(2, simulator.btsPlayback(1, 1).playback().cycleNo()); |
| | | |
| | | simulator.advanceBts(Instant.now().plusSeconds(60)); |
| | | int historyCount = simulator.btsRecords(1, 1).size(); |
| | | simulator.setAllDevicesPoweredOn(false); |
| | | simulator.setAllDevicesPoweredOn(true); |
| | | |
| | | BtsDevelopmentSimulator.PlaybackSnapshot playback = simulator.btsPlayback(1, 1); |
| | | assertEquals(1, playback.playback().cycleNo()); |
| | | assertEquals(1, playback.playback().stepNo()); |
| | | assertFalse(playback.playback().naturallyFinished()); |
| | | assertTrue(historyCount > 0); |
| | | assertEquals(0, playback.records().size()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | void playbackFollowsExcelFixtureThroughAllCyclesAndRecords() throws Exception |
| | | { |
| | | Instant start = Instant.parse("2026-08-31T00:00:00Z"); |