1. 添加策略模板API文档

This commit is contained in:
EnderByEndera
2024-01-12 19:25:14 +08:00
parent 8a719709a3
commit bf99b41af3
6 changed files with 8 additions and 26 deletions

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.realtime.protection.server.user.login.LoginMapper">
<select id="login" resultType="java.lang.Integer">
select test_id from t_test
where username = #{username} and passwd = #{password}
</select>
</mapper>

View File

@@ -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));
}
}

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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 {