1. 更新防护对象和模板的查询,添加更多筛选条件
This commit is contained in:
@@ -39,8 +39,12 @@ public class AlertMessageTest {
|
||||
@Test
|
||||
void testReceiveAlertMessage() {
|
||||
|
||||
List<ProtectObject> protectObject = protectObjectService.queryProtectObjects(null, null, 1, 1);
|
||||
List<Template> templates = templateService.queryTemplates(null, 1, 1);
|
||||
List<ProtectObject> protectObject = protectObjectService.queryProtectObjects(
|
||||
null, null, null, null,
|
||||
null, null, null, null,
|
||||
null, null, 1, 1);
|
||||
List<Template> templates = templateService.queryTemplates(
|
||||
null, null, null,1, 1);
|
||||
|
||||
DynamicRuleObject object = new DynamicRuleObject();
|
||||
object.setDynamicRuleName("UpdateDynamicRule2");
|
||||
|
||||
@@ -82,7 +82,8 @@ class TemplateServiceTest extends ProtectionApplicationTests {
|
||||
|
||||
@Test
|
||||
void testQueryTemplate() {
|
||||
List<Template> templates = templateService.queryTemplates("DDOS", 1, 5);
|
||||
List<Template> templates = templateService.queryTemplates(
|
||||
"DDOS", null, null,1, 5);
|
||||
assertEquals(5, templates.size());
|
||||
for (Template template : templates) {
|
||||
assertTrue(template.getTemplateId() > 0);
|
||||
@@ -93,7 +94,8 @@ class TemplateServiceTest extends ProtectionApplicationTests {
|
||||
|
||||
@Test
|
||||
void testUpdateTemplateSuccess() {
|
||||
List<Template> templates = templateService.queryTemplates("DDOS", 1, 1);
|
||||
List<Template> templates = templateService.queryTemplates(
|
||||
"DDOS", null, null, 1, 1);
|
||||
Template testTemplate = templates.get(0);
|
||||
testTemplate.setTemplateName("洪泛型DDOS攻击-" + LocalDateTime.now());
|
||||
|
||||
|
||||
@@ -12,10 +12,8 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cglib.core.Local;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -30,7 +28,7 @@ class TaskServiceTest extends ProtectionApplicationTests {
|
||||
private Task task;
|
||||
|
||||
@Autowired
|
||||
TaskServiceTest(TaskService taskService, StaticRuleService staticRuleService, DynamicRuleService dynamicRuleService, StateChangeService stateChangeService) {
|
||||
TaskServiceTest(TaskService taskService, StaticRuleService staticRuleService, DynamicRuleService dynamicRuleService) {
|
||||
this.taskService = taskService;
|
||||
this.staticRuleService = staticRuleService;
|
||||
this.dynamicRuleService = dynamicRuleService;
|
||||
|
||||
Reference in New Issue
Block a user