| File was renamed from ruoyi-admin/src/test/java/com/ruoyi/system/service/impl/TDetectionCabinetServiceImplTest.java |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | package com.battery.business.service.impl; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | import org.mockito.Mock; |
| | | import org.mockito.junit.jupiter.MockitoExtension; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.system.domain.TDetectionCabinet; |
| | | import com.ruoyi.system.domain.vo.DiscoveredCabinetVo; |
| | | import com.ruoyi.system.mapper.TDetectionCabinetMapper; |
| | | import com.battery.device.discovery.InMemoryDeviceDiscoveryCandidateStore; |
| | | import com.battery.device.discovery.DeviceDiscoveryCandidateStore.CabinetCandidate; |
| | | import com.battery.device.discovery.DeviceDiscoveryCandidateStore.ChannelCandidate; |
| | | import com.battery.device.model.ChannelIdentity; |
| | | import com.battery.device.model.DeviceWorkStatus; |
| | | import com.battery.business.domain.TDetectionCabinet; |
| | | import com.battery.business.domain.vo.DiscoveredCabinetVo; |
| | | import com.battery.business.mapper.TDetectionCabinetMapper; |
| | | import com.battery.device.api.discovery.InMemoryDeviceDiscoveryCandidateStore; |
| | | import com.battery.device.api.discovery.DeviceDiscoveryCandidateStore.CabinetCandidate; |
| | | import com.battery.device.api.discovery.DeviceDiscoveryCandidateStore.ChannelCandidate; |
| | | import com.battery.device.api.model.ChannelIdentity; |
| | | import com.battery.device.api.model.DeviceWorkStatus; |
| | | |
| | | /** |
| | | * 检测柜业务层单元测试,验证字段规范化、状态限制及唯一性校验等关键规则。 |
| | |
| | | void discoveredCabinetSqlShouldNotReadLegacyTestColumns() throws IOException |
| | | { |
| | | try (InputStream input = getClass().getResourceAsStream( |
| | | "/mapper/system/TDetectionCabinetMapper.xml")) |
| | | "/mapper/battery/TDetectionCabinetMapper.xml")) |
| | | { |
| | | assertNotNull(input); |
| | | String mapperXml = new String(input.readAllBytes(), StandardCharsets.UTF_8); |
| | |
| | | void deleteDetectionCabinetSqlShouldReturnOnlineDeviceToDiscoveryPool() throws IOException |
| | | { |
| | | try (InputStream input = getClass().getResourceAsStream( |
| | | "/mapper/system/TDetectionCabinetMapper.xml")) |
| | | "/mapper/battery/TDetectionCabinetMapper.xml")) |
| | | { |
| | | assertNotNull(input); |
| | | String mapperXml = new String(input.readAllBytes(), StandardCharsets.UTF_8); |
| | |
| | | void detectionCabinetListSqlShouldDeriveLegacyPresentationFields() throws IOException |
| | | { |
| | | try (InputStream input = getClass().getResourceAsStream( |
| | | "/mapper/system/TDetectionCabinetMapper.xml")) |
| | | "/mapper/battery/TDetectionCabinetMapper.xml")) |
| | | { |
| | | assertNotNull(input); |
| | | String mapperXml = new String(input.readAllBytes(), StandardCharsets.UTF_8); |
| | |
| | | void registeredObservationSqlShouldRepairLegacyVendorIdentity() throws IOException |
| | | { |
| | | try (InputStream input = getClass().getResourceAsStream( |
| | | "/mapper/system/TDetectionCabinetMapper.xml")) |
| | | "/mapper/battery/TDetectionCabinetMapper.xml")) |
| | | { |
| | | assertNotNull(input); |
| | | String mapperXml = new String(input.readAllBytes(), StandardCharsets.UTF_8); |