yeg
2026-08-30 cc1f07604727a966181334ef76b8445750ddadd2
ruoyi-admin/src/test/java/com/ruoyi/web/controller/device/BtsDevelopmentSimulatorControllerTest.java
@@ -5,6 +5,8 @@
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;
@@ -23,6 +25,7 @@
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
{
@@ -170,6 +173,21 @@
    }
    @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))