| | |
| | | import static org.junit.jupiter.api.Assertions.assertTrue; |
| | | import static org.junit.jupiter.api.Assertions.assertArrayEquals; |
| | | import static org.junit.jupiter.api.Assertions.assertThrows; |
| | | import static org.mockito.Mockito.mock; |
| | | import static org.mockito.Mockito.verify; |
| | | import java.lang.reflect.Method; |
| | | import java.math.BigDecimal; |
| | | import java.net.InetAddress; |
| | |
| | | import com.ruoyi.device.model.ChannelIdentity; |
| | | import com.ruoyi.device.model.DeviceWorkStatus; |
| | | import com.ruoyi.web.config.BtsDevelopmentSimulatorWebConfig; |
| | | import com.ruoyi.config.DevelopmentCollectorStatusSynchronizer; |
| | | |
| | | class BtsDevelopmentSimulatorControllerTest |
| | | { |
| | |
| | | } |
| | | |
| | | @Test |
| | | void powerChangeImmediatelyReconcilesCollectorStatus() throws Exception |
| | | { |
| | | try (BtsDevelopmentSimulator simulator = new BtsDevelopmentSimulator(0)) |
| | | { |
| | | DevelopmentCollectorStatusSynchronizer synchronizer = mock(DevelopmentCollectorStatusSynchronizer.class); |
| | | BtsDevelopmentSimulatorController controller = new BtsDevelopmentSimulatorController(simulator, |
| | | new InMemoryDeviceDiscoveryCandidateStore(), synchronizer); |
| | | |
| | | controller.setPower(new BtsDevelopmentSimulatorController.SimulatorPowerCommand(true)); |
| | | |
| | | verify(synchronizer).synchronizeOnlineStatus(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | void simulatorPowerCommandRequiresExplicitState() throws Exception |
| | | { |
| | | try (BtsDevelopmentSimulator simulator = new BtsDevelopmentSimulator(0)) |