REM:
1. 修改停止指定任务接口和获取处置任务详细信息接口的剩余时间
2. 修改任务管理的冒烟测试代码
This commit is contained in:
chenlinghy 2020-05-11 10:56:24 +08:00
parent b5fc6d03cd
commit d20b37fd0a
2 changed files with 6 additions and 6 deletions

View File

@ -194,7 +194,7 @@ public class DisposeTaskController {
taskData.setType(taskInfo.getType());
taskData.setDisposeIp(taskInfo.getDisposeIp());
taskData.setLeftTime(Math.abs(Helper.getTimestampDiffNow(taskInfo.getBeginTime())
- Helper.getTimestampDiffNow(taskInfo.getPlanEndTime())));
- Helper.getTimestampDiffNow(taskInfo.getPlanEndTime())) /60 );
taskData.setStatus(retError.getCode());
taskData.setMessage(retError.getMsg());
@ -528,7 +528,7 @@ public class DisposeTaskController {
.taskId(v.getId().toString())
.type(v.getType())
.startTime(Helper.getTimestampSecond(v.getBeginTime()))
.disposeTime(diff)
.disposeTime(diff / 60)
.disposeIp(v.getDisposeIp())
.attackType(Helper.attackStringToArray(v.getAttackType()))
.flowDirection(v.getFlowDirection())

View File

@ -54,7 +54,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
"\"msgContent\":\"{\\\"id\\\":-1," +
"\\\"type\\\":0, " +
"\\\"disposeIp\\\":\\\"192.168.5.5\\\", " +
"\\\"disposeIp\\\":\\\"192.168.3.2\\\", " +
"\\\"disposeTime\\\":120}\"}";
String taskStart = mockMvc.perform(MockMvcRequestBuilders
@ -88,7 +88,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
@Test
public void t2_NormalStopTaskTest() throws Exception {
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
"\"msgContent\":\"{\\\"taskId\\\":[\\\"236\\\", \\\"235\\\" ]}\"}";
"\"msgContent\":\"{\\\"taskId\\\":[\\\"1\\\", \\\"2\\\" ]}\"}";
String taskStop = mockMvc.perform(MockMvcRequestBuilders
.post("/task/stop")
@ -135,7 +135,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
@Test
public void t3_NormalStopTaskByDisposeIpTest() throws Exception {
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988,\"msgContent\": \"{\\\"items\\\":" +
"[{\\\"id\\\":\\\"1\\\",\\\"type\\\":0,\\\"disposeIp\\\":\\\"192.168.3.4\\\"}]}\"}";
"[{\\\"id\\\":\\\"1\\\",\\\"type\\\":0,\\\"disposeIp\\\":\\\"192.168.3.2\\\"}]}\"}";
String taskStopByIp = mockMvc.perform(MockMvcRequestBuilders
.post("/task/stop_ip")
@ -181,7 +181,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
@Test
public void t4_NormalGetNodeDetailedInfoTest() throws Exception {
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
"\"msgContent\":\"{\\\"taskId\\\":[\\\"277\\\"]}\"}";
"\"msgContent\":\"{\\\"taskId\\\":[\\\"1\\\", \\\"2\\\"]}\"}";
String getNodeDetailedInfo = mockMvc.perform(MockMvcRequestBuilders
.post("/task/get")