From 2c08b1cb394168fbf216d3b1720dc42785cfe6f0 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Wed, 26 Aug 2020 17:08:30 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E8=A7=A3=E5=86=B3manager?= =?UTF-8?q?=E5=B1=82=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=9A=84=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/DisposeDeviceManagerTest.java | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) 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);