1、修复bug
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.realtime.protection.server.defense.templatenew;
|
||||
|
||||
import com.realtime.protection.configuration.entity.defense.template.Template;
|
||||
import com.realtime.protection.configuration.entity.defense.template.TemplateNew;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -9,6 +10,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
@@ -68,5 +70,14 @@ public class NewTemplateServiceTest {
|
||||
assertTrue(templateId > 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@Test
|
||||
void testUpdateTemplateAuditStatus(){
|
||||
List<TemplateNew> templates = templateService.queryTemplates(
|
||||
null, null, null, null, null,null, null,1,3);
|
||||
TemplateNew testTemplate = templates.get(0);
|
||||
templateService.updateAuditStatus(testTemplate.getTemplateId(), 2, null,null,null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@ package com.realtime.protection.server.rule.dynamic;
|
||||
import com.realtime.protection.ProtectionApplicationTests;
|
||||
import com.realtime.protection.configuration.entity.defense.object.ProtectObject;
|
||||
import com.realtime.protection.configuration.entity.defense.template.Template;
|
||||
import com.realtime.protection.configuration.entity.defense.template.TemplateNew;
|
||||
import com.realtime.protection.configuration.entity.rule.dynamicrule.DynamicRuleObject;
|
||||
import com.realtime.protection.configuration.entity.task.DynamicTaskInfo;
|
||||
import com.realtime.protection.configuration.entity.task.Task;
|
||||
import com.realtime.protection.server.defense.object.ProtectObjectService;
|
||||
import com.realtime.protection.server.defense.template.TemplateService;
|
||||
import com.realtime.protection.server.defense.templatenew.TemplateService;
|
||||
import com.realtime.protection.server.rule.dynamicrule.DynamicRuleService;
|
||||
import com.realtime.protection.server.task.TaskService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -71,8 +72,8 @@ public class DynamicRuleServiceTest extends ProtectionApplicationTests {
|
||||
null,
|
||||
null,
|
||||
1, 1);
|
||||
List<Template> templates = templateService.queryTemplates(
|
||||
null, null,null, null, null,1, 1);
|
||||
List<TemplateNew> templates = templateService.queryTemplates(
|
||||
null, null,null, null, null,null,null,1, 1);
|
||||
|
||||
DynamicRuleObject object = new DynamicRuleObject();
|
||||
object.setDynamicRuleName("UpdateDynamicRule2");
|
||||
|
||||
@@ -86,7 +86,7 @@ class WhiteListServiceTest extends ProtectionApplicationTests {
|
||||
|
||||
@Test
|
||||
void testUpdateWhiteListAuditStatus() {
|
||||
//whiteListService.updateWhiteListObjectAuditStatus(7, 1);
|
||||
whiteListService.updateWhiteListObjectAuditStatus(7222, 2, "mh", 1, "mmeess");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -144,7 +144,7 @@ class WhiteListServiceTest extends ProtectionApplicationTests {
|
||||
|
||||
@Test
|
||||
void testUpdateAuditStatusByIdBatch() {
|
||||
Map<Integer, Integer> idsWithAuditStatusMap = Map.of(7189, 2, 7192, 2);
|
||||
Map<Integer, Integer> idsWithAuditStatusMap = Map.of(7220, 2, 7222, 2);
|
||||
|
||||
whiteListService.updateAuditStatusBatch(idsWithAuditStatusMap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user