diff --git a/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java b/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java index 1a816c73..6c0092ec 100644 --- a/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java +++ b/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java @@ -1,11 +1,9 @@ package com.dispose.test.manager; -import com.dispose.common.DisposeDeviceType; -import com.dispose.common.ErrorCode; -import com.dispose.common.HttpType; -import com.dispose.common.ObjectStatus; +import com.dispose.common.*; import com.dispose.manager.DisposeDeviceManager; import com.dispose.mapper.DisposeDeviceMapper; +import com.dispose.pojo.entity.DisposeCapacity; import com.dispose.pojo.entity.DisposeDevice; import com.dispose.pojo.po.MulReturnType; import com.fasterxml.jackson.core.JsonProcessingException; @@ -62,6 +60,16 @@ public class DisposeDeviceManagerTest { */ @Test public void a1_addDisposeDevice() { + Long deviceId = disposeDeviceMapper.selectAll().get(0).getId(); + List devCap = new ArrayList<>(); + + devCap.add(DisposeCapacity.builder() + .deviceId(deviceId) + .ipType(IpAddrType.IPV4_IPV6) + .capacityType(DisposeCapacityType.CLEANUP) + .objectType(DisposeObjectType.IP) + .protectIp("") + .build()); for (int i = 1; i < 3; i++) { String ipAddr = "192.168.0." + i; @@ -81,6 +89,7 @@ public class DisposeDeviceManagerTest { .urlType(HttpType.HTTP) .readme("实验室测试设备") .status(ObjectStatus.NORMAL) + .devCapacity(devCap) .build(); MulReturnType ret = disposeDeviceManager.addDisposeDevice(dev); @@ -122,6 +131,16 @@ public class DisposeDeviceManagerTest { */ @Test public void a2_upgradeDisposeDevice() throws JsonProcessingException { + Long deviceId = disposeDeviceMapper.selectAll().get(0).getId(); + List devCap = new ArrayList<>(); + + devCap.add(DisposeCapacity.builder() + .deviceId(deviceId) + .ipType(IpAddrType.IPV4_IPV6) + .capacityType(DisposeCapacityType.CLEANUP) + .objectType(DisposeObjectType.IP) + .protectIp("") + .build()); for (int i = 1; i < 3; i++) { String ipAddr = "192.168.0." + i; @@ -141,6 +160,7 @@ public class DisposeDeviceManagerTest { .urlType(HttpType.HTTP) .readme("实验室测试设备") .status(ObjectStatus.NORMAL) + .devCapacity(devCap) .build(); disposeDeviceManager.addDisposeDevice(dev);