From bf99b41af3bfbb7167fafca77c80bf8a1c6c74a1 Mon Sep 17 00:00:00 2001 From: EnderByEndera <707475564@qq.com> Date: Fri, 12 Jan 2024 19:25:14 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=B7=BB=E5=8A=A0=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BFAPI=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mappers/LoginMapper.xml | 10 ---------- .../defense/object/ProtectObjectServiceTest.java | 9 ++------- .../server/rule/staticrule/StaticRuleServiceTest.java | 4 ++-- .../protection/server/task/TaskServiceTest.java | 3 +-- .../server/task/status/CommandServiceTest.java | 5 ++--- .../server/whitelist/WhiteListServiceTest.java | 3 +-- 6 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 src/main/resources/mappers/LoginMapper.xml diff --git a/src/main/resources/mappers/LoginMapper.xml b/src/main/resources/mappers/LoginMapper.xml deleted file mode 100644 index 52628be..0000000 --- a/src/main/resources/mappers/LoginMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/test/java/com/realtime/protection/server/defense/object/ProtectObjectServiceTest.java b/src/test/java/com/realtime/protection/server/defense/object/ProtectObjectServiceTest.java index 295b5ee..a537549 100644 --- a/src/test/java/com/realtime/protection/server/defense/object/ProtectObjectServiceTest.java +++ b/src/test/java/com/realtime/protection/server/defense/object/ProtectObjectServiceTest.java @@ -1,7 +1,6 @@ package com.realtime.protection.server.defense.object; import com.realtime.protection.configuration.entity.defense.object.ProtectObject; -import org.apache.ibatis.exceptions.PersistenceException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -42,9 +41,7 @@ class ProtectObjectServiceTest { protectObject.setProtectObjectId(null); protectObject.setProtectObjectProtocol(null); - assertThrows(DataIntegrityViolationException.class, () -> { - assertTrue(protectObjectService.newProtectObject(protectObject) > 0); - }); + assertThrows(DataIntegrityViolationException.class, () -> assertTrue(protectObjectService.newProtectObject(protectObject) > 0)); } @Test @@ -111,8 +108,6 @@ class ProtectObjectServiceTest { } assertTrue((Boolean) protectObjectService.changeProtectObjectAuditStatus(testNum, 1).get("success")); int finalTestNum = testNum; - assertThrows(IllegalArgumentException.class, () -> { - protectObjectService.changeProtectObjectAuditStatus(finalTestNum, 2); - }); + assertThrows(IllegalArgumentException.class, () -> protectObjectService.changeProtectObjectAuditStatus(finalTestNum, 2)); } } \ No newline at end of file diff --git a/src/test/java/com/realtime/protection/server/rule/staticrule/StaticRuleServiceTest.java b/src/test/java/com/realtime/protection/server/rule/staticrule/StaticRuleServiceTest.java index 3b9ab36..d86b764 100644 --- a/src/test/java/com/realtime/protection/server/rule/staticrule/StaticRuleServiceTest.java +++ b/src/test/java/com/realtime/protection/server/rule/staticrule/StaticRuleServiceTest.java @@ -6,11 +6,11 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import java.time.LocalDateTime; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertTrue; @SpringBootTest public class StaticRuleServiceTest { diff --git a/src/test/java/com/realtime/protection/server/task/TaskServiceTest.java b/src/test/java/com/realtime/protection/server/task/TaskServiceTest.java index 460e8d1..38d0221 100644 --- a/src/test/java/com/realtime/protection/server/task/TaskServiceTest.java +++ b/src/test/java/com/realtime/protection/server/task/TaskServiceTest.java @@ -1,8 +1,7 @@ package com.realtime.protection.server.task; -import com.realtime.protection.configuration.entity.task.TaskCommandInfo; import com.realtime.protection.configuration.entity.task.Task; -import org.apache.ibatis.exceptions.PersistenceException; +import com.realtime.protection.configuration.entity.task.TaskCommandInfo; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/com/realtime/protection/server/task/status/CommandServiceTest.java b/src/test/java/com/realtime/protection/server/task/status/CommandServiceTest.java index fc69305..5da9529 100644 --- a/src/test/java/com/realtime/protection/server/task/status/CommandServiceTest.java +++ b/src/test/java/com/realtime/protection/server/task/status/CommandServiceTest.java @@ -1,8 +1,7 @@ package com.realtime.protection.server.task.status; -import com.realtime.protection.configuration.entity.task.TaskCommandInfo; -import com.realtime.protection.configuration.entity.task.Command; import com.realtime.protection.configuration.entity.task.FiveTupleWithMask; +import com.realtime.protection.configuration.entity.task.TaskCommandInfo; import com.realtime.protection.server.command.CommandService; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -14,7 +13,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; @SpringBootTest class CommandServiceTest { diff --git a/src/test/java/com/realtime/protection/server/whitelist/WhiteListServiceTest.java b/src/test/java/com/realtime/protection/server/whitelist/WhiteListServiceTest.java index f764f0c..7706370 100644 --- a/src/test/java/com/realtime/protection/server/whitelist/WhiteListServiceTest.java +++ b/src/test/java/com/realtime/protection/server/whitelist/WhiteListServiceTest.java @@ -1,6 +1,5 @@ package com.realtime.protection.server.whitelist; -import com.realtime.protection.configuration.entity.task.Command; import com.realtime.protection.configuration.entity.whitelist.WhiteListObject; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -10,7 +9,7 @@ import org.springframework.boot.test.context.SpringBootTest; import java.util.ArrayList; import java.util.List; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertTrue; @SpringBootTest class WhiteListServiceTest {