OCT
REM: 1. 修改停止指定任务接口和获取处置任务详细信息接口的剩余时间 2. 修改任务管理的冒烟测试代码
This commit is contained in:
parent
b5fc6d03cd
commit
d20b37fd0a
|
@ -194,7 +194,7 @@ public class DisposeTaskController {
|
||||||
taskData.setType(taskInfo.getType());
|
taskData.setType(taskInfo.getType());
|
||||||
taskData.setDisposeIp(taskInfo.getDisposeIp());
|
taskData.setDisposeIp(taskInfo.getDisposeIp());
|
||||||
taskData.setLeftTime(Math.abs(Helper.getTimestampDiffNow(taskInfo.getBeginTime())
|
taskData.setLeftTime(Math.abs(Helper.getTimestampDiffNow(taskInfo.getBeginTime())
|
||||||
- Helper.getTimestampDiffNow(taskInfo.getPlanEndTime())));
|
- Helper.getTimestampDiffNow(taskInfo.getPlanEndTime())) /60 );
|
||||||
|
|
||||||
taskData.setStatus(retError.getCode());
|
taskData.setStatus(retError.getCode());
|
||||||
taskData.setMessage(retError.getMsg());
|
taskData.setMessage(retError.getMsg());
|
||||||
|
@ -528,7 +528,7 @@ public class DisposeTaskController {
|
||||||
.taskId(v.getId().toString())
|
.taskId(v.getId().toString())
|
||||||
.type(v.getType())
|
.type(v.getType())
|
||||||
.startTime(Helper.getTimestampSecond(v.getBeginTime()))
|
.startTime(Helper.getTimestampSecond(v.getBeginTime()))
|
||||||
.disposeTime(diff)
|
.disposeTime(diff / 60)
|
||||||
.disposeIp(v.getDisposeIp())
|
.disposeIp(v.getDisposeIp())
|
||||||
.attackType(Helper.attackStringToArray(v.getAttackType()))
|
.attackType(Helper.attackStringToArray(v.getAttackType()))
|
||||||
.flowDirection(v.getFlowDirection())
|
.flowDirection(v.getFlowDirection())
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
|
||||||
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
|
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
|
||||||
"\"msgContent\":\"{\\\"id\\\":-1," +
|
"\"msgContent\":\"{\\\"id\\\":-1," +
|
||||||
"\\\"type\\\":0, " +
|
"\\\"type\\\":0, " +
|
||||||
"\\\"disposeIp\\\":\\\"192.168.5.5\\\", " +
|
"\\\"disposeIp\\\":\\\"192.168.3.2\\\", " +
|
||||||
"\\\"disposeTime\\\":120}\"}";
|
"\\\"disposeTime\\\":120}\"}";
|
||||||
|
|
||||||
String taskStart = mockMvc.perform(MockMvcRequestBuilders
|
String taskStart = mockMvc.perform(MockMvcRequestBuilders
|
||||||
|
@ -88,7 +88,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
|
||||||
@Test
|
@Test
|
||||||
public void t2_NormalStopTaskTest() throws Exception {
|
public void t2_NormalStopTaskTest() throws Exception {
|
||||||
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
|
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
|
||||||
"\"msgContent\":\"{\\\"taskId\\\":[\\\"236\\\", \\\"235\\\" ]}\"}";
|
"\"msgContent\":\"{\\\"taskId\\\":[\\\"1\\\", \\\"2\\\" ]}\"}";
|
||||||
|
|
||||||
String taskStop = mockMvc.perform(MockMvcRequestBuilders
|
String taskStop = mockMvc.perform(MockMvcRequestBuilders
|
||||||
.post("/task/stop")
|
.post("/task/stop")
|
||||||
|
@ -135,7 +135,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
|
||||||
@Test
|
@Test
|
||||||
public void t3_NormalStopTaskByDisposeIpTest() throws Exception {
|
public void t3_NormalStopTaskByDisposeIpTest() throws Exception {
|
||||||
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988,\"msgContent\": \"{\\\"items\\\":" +
|
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
|
String taskStopByIp = mockMvc.perform(MockMvcRequestBuilders
|
||||||
.post("/task/stop_ip")
|
.post("/task/stop_ip")
|
||||||
|
@ -181,7 +181,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment {
|
||||||
@Test
|
@Test
|
||||||
public void t4_NormalGetNodeDetailedInfoTest() throws Exception {
|
public void t4_NormalGetNodeDetailedInfoTest() throws Exception {
|
||||||
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
|
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," +
|
||||||
"\"msgContent\":\"{\\\"taskId\\\":[\\\"277\\\"]}\"}";
|
"\"msgContent\":\"{\\\"taskId\\\":[\\\"1\\\", \\\"2\\\"]}\"}";
|
||||||
|
|
||||||
String getNodeDetailedInfo = mockMvc.perform(MockMvcRequestBuilders
|
String getNodeDetailedInfo = mockMvc.perform(MockMvcRequestBuilders
|
||||||
.post("/task/get")
|
.post("/task/get")
|
||||||
|
|
Loading…
Reference in New Issue