parent
9e912dcfc3
commit
39574b74a9
|
@ -16,8 +16,8 @@ import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq;
|
|||
import com.dispose.pojo.dto.protocol.task.GetDeviceTaskDetail;
|
||||
import com.dispose.pojo.dto.protocol.task.GetTaskDetail;
|
||||
import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartReq;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartReq;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStopItem;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
|
||||
|
@ -91,9 +91,9 @@ public class DisposeTaskController {
|
|||
@ResponseBody
|
||||
@ApiOperation("启动处置任务")
|
||||
public ProtocolRespDTO<? extends BaseRespStatus> startTask(@Validated(ValidGroups.TaskStartReqValid.class)
|
||||
@RequestBody ProtocolReqDTO<TaskStartReq> mr,
|
||||
@RequestBody ProtocolReqDTO<IpTaskStartReq> mr,
|
||||
@NotNull @RequestHeader HttpHeaders headers) {
|
||||
TaskStartReq req = mr.getMsgContent();
|
||||
IpTaskStartReq req = mr.getMsgContent();
|
||||
|
||||
// 构造处置任务参数
|
||||
DisposeTask task = DisposeTask.builder()
|
||||
|
@ -150,10 +150,10 @@ public class DisposeTaskController {
|
|||
@PostMapping("/startMulIp")
|
||||
@ResponseBody
|
||||
@ApiOperation("启动处置任务")
|
||||
public ProtocolRespDTO<TaskStartMulRsp> startTaskMulIp(@Validated(ValidGroups.TaskStartMulReqValid.class)
|
||||
@RequestBody ProtocolReqDTO<TaskStartReq> mr,
|
||||
public ProtocolRespDTO<IpTaskStartMulRsp> startTaskMulIp(@Validated(ValidGroups.TaskStartMulReqValid.class)
|
||||
@RequestBody ProtocolReqDTO<IpTaskStartReq> mr,
|
||||
@NotNull @RequestHeader HttpHeaders headers) {
|
||||
TaskStartReq req = mr.getMsgContent();
|
||||
IpTaskStartReq req = mr.getMsgContent();
|
||||
Long devId = Long.parseLong(Optional.ofNullable(req.getId()).orElse("-1"));
|
||||
Long aId = userAccountService.getUserIdByAuthHead(Objects.requireNonNull(headers.get("Authorization")).get(0));
|
||||
DisposeCapacityType capType = CommonEnumHandler.codeOf(DisposeCapacityType.class, req.getType());
|
||||
|
@ -165,7 +165,7 @@ public class DisposeTaskController {
|
|||
Integer flowBand = Optional.ofNullable(req.getFlowBandwidth())
|
||||
.orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH);
|
||||
|
||||
TaskStartMulRsp mulRsp = TaskStartMulRsp.builder()
|
||||
IpTaskStartMulRsp mulRsp = IpTaskStartMulRsp.builder()
|
||||
.items(new ArrayList<>())
|
||||
.build();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class TaskStartMulRsp extends BaseRespStatus {
|
||||
public class IpTaskStartMulRsp extends BaseRespStatus {
|
||||
/**
|
||||
* The Items.
|
||||
*/
|
|
@ -28,7 +28,7 @@ import javax.validation.constraints.Size;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class TaskStartReq {
|
||||
public class IpTaskStartReq {
|
||||
/**
|
||||
* The Id.
|
||||
*/
|
|
@ -14,8 +14,8 @@ import com.dispose.pojo.dto.protocol.base.ProtocolReqDTO;
|
|||
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
|
||||
import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq;
|
||||
import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartReq;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartReq;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStopItem;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
|
||||
|
@ -101,7 +101,7 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
*/
|
||||
@Test
|
||||
public void a1_startTask() throws Exception {
|
||||
TaskStartReq req = TaskStartReq.builder()
|
||||
IpTaskStartReq req = IpTaskStartReq.builder()
|
||||
.id(String.valueOf(disposeDeviceManagerService.getAllDisposeDevice().get(0).getId()))
|
||||
.type(DisposeCapacityType.CLEANUP.getValue())
|
||||
.disposeIp("192.168.100.100")
|
||||
|
@ -111,7 +111,7 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
.flowBandwidth(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH)
|
||||
.build();
|
||||
|
||||
ProtocolReqDTO<TaskStartReq> reqInfo = new ProtocolReqDTO<>();
|
||||
ProtocolReqDTO<IpTaskStartReq> reqInfo = new ProtocolReqDTO<>();
|
||||
|
||||
reqInfo.setVer(ConstValue.Protocol.VERSION);
|
||||
reqInfo.setCryptoType(ProtoCryptoType.CRYPTO_NONE.getCode());
|
||||
|
@ -161,7 +161,7 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
public void a2_startTaskExisted() throws Exception {
|
||||
DisposeTask disposeTask = disposeTaskMapper.selectAll().get(0);
|
||||
|
||||
TaskStartReq req = TaskStartReq.builder()
|
||||
IpTaskStartReq req = IpTaskStartReq.builder()
|
||||
.id(String.valueOf(disposeTask.getDeviceId()))
|
||||
.type(disposeTask.getDisposeCapacity().getValue())
|
||||
.disposeIp(disposeTask.getDisposeObject())
|
||||
|
@ -171,7 +171,7 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
.flowBandwidth(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH)
|
||||
.build();
|
||||
|
||||
ProtocolReqDTO<TaskStartReq> reqInfo = new ProtocolReqDTO<>();
|
||||
ProtocolReqDTO<IpTaskStartReq> reqInfo = new ProtocolReqDTO<>();
|
||||
|
||||
reqInfo.setVer(ConstValue.Protocol.VERSION);
|
||||
reqInfo.setCryptoType(ProtoCryptoType.CRYPTO_NONE.getCode());
|
||||
|
@ -290,7 +290,7 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
public void a4_startTaskMulIp() throws Exception {
|
||||
String[] mulDisposeIp = {"192.168.5.2", "192.168.5.3"};
|
||||
|
||||
TaskStartReq req = TaskStartReq.builder()
|
||||
IpTaskStartReq req = IpTaskStartReq.builder()
|
||||
.id(String.valueOf(disposeDeviceManagerService.getAllDisposeDevice().get(0).getId()))
|
||||
.type(DisposeCapacityType.CLEANUP.getValue())
|
||||
.mulDisposeIp(mulDisposeIp)
|
||||
|
@ -300,7 +300,7 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
.flowBandwidth(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH)
|
||||
.build();
|
||||
|
||||
ProtocolReqDTO<TaskStartReq> reqInfo = new ProtocolReqDTO<>();
|
||||
ProtocolReqDTO<IpTaskStartReq> reqInfo = new ProtocolReqDTO<>();
|
||||
|
||||
reqInfo.setVer(ConstValue.Protocol.VERSION);
|
||||
reqInfo.setCryptoType(ProtoCryptoType.CRYPTO_NONE.getCode());
|
||||
|
@ -320,8 +320,8 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
|
|||
|
||||
|
||||
log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(ret));
|
||||
ProtocolRespDTO<TaskStartMulRsp> rspInfo = objectMapper.readValue(ret,
|
||||
new TypeReference<ProtocolRespDTO<TaskStartMulRsp>>() {
|
||||
ProtocolRespDTO<IpTaskStartMulRsp> rspInfo = objectMapper.readValue(ret,
|
||||
new TypeReference<ProtocolRespDTO<IpTaskStartMulRsp>>() {
|
||||
});
|
||||
|
||||
verifyRespProtocol(rspInfo);
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.dispose.common.SecurityConfigValue;
|
|||
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
||||
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
|
||||
import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
|
||||
import com.dispose.test.common.QATestItem;
|
||||
import com.dispose.test.common.TestPriority;
|
||||
import com.dispose.test.common.VerifyProtoRespCallback;
|
||||
|
@ -38,10 +38,10 @@ public class CodeCoverage {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.\",\"192.168.50\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) CodeCoverage::verifyJsonExceptionResp)
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) CodeCoverage::verifyJsonExceptionResp)
|
||||
.prepareCallback(c -> SecurityConfigValue.SECURITY_PROTOCOL_TYPE = ProtoCryptoType.CRYPTO_BASE64.getCode())
|
||||
.build(),
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.dispose.test.testcase.qa.v200;
|
|||
import com.dispose.common.ErrorCode;
|
||||
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
||||
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
|
||||
import com.dispose.test.common.QATestItem;
|
||||
import com.dispose.test.common.TestPriority;
|
||||
import com.dispose.test.common.VerifyProtoRespCallback;
|
||||
|
@ -37,10 +37,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -54,10 +54,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[-1]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -71,10 +71,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -89,10 +89,10 @@ public class P2TaskStartMulIp {
|
|||
"\"mulDisposeIp\":[\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"," +
|
||||
"\"ABCD:EF01:2345:6789:ABCD:EF01:2345:1234\"],\"disposeTime\":10,\"flowDirection\":2," +
|
||||
"\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789", "ABCD:EF01:2345:6789:ABCD:EF01:2345:1234"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -107,10 +107,10 @@ public class P2TaskStartMulIp {
|
|||
"\"mulDisposeIp\":[\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"," +
|
||||
"\"ABCD:EF01:2345:6789:ABCD:EF01:2345:1234\"],\"disposeTime\":10,\"flowDirection\":2," +
|
||||
"\"attackType\":[-1]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789", "ABCD:EF01:2345:6789:ABCD:EF01:2345:1234"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -125,10 +125,10 @@ public class P2TaskStartMulIp {
|
|||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"," +
|
||||
"\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"],\"disposeTime\":10,\"flowDirection\":2," +
|
||||
"\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3","ABCD:EF01:2345:6789:ABCD:EF01:2345:6789"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -142,10 +142,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":0,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -159,10 +159,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":1,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -176,10 +176,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":2," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[-1]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -193,10 +193,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":1," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[-1]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -210,10 +210,10 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":3," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[-1]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_OK)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
|
||||
"192.168.50.4", "192.168.50.3"
|
||||
}))
|
||||
.build(),
|
||||
|
@ -225,7 +225,7 @@ public class P2TaskStartMulIp {
|
|||
.urlPath("/task/startMulIp")
|
||||
.method(RequestMethod.POST)
|
||||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -240,7 +240,7 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":null," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -255,7 +255,7 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":\"0\"," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
|
||||
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -269,7 +269,7 @@ public class P2TaskStartMulIp {
|
|||
.method(RequestMethod.POST)
|
||||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"disposeIp\":null,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -284,7 +284,7 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"disposeIp\":192.168.50.2,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1," +
|
||||
"2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -299,7 +299,7 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":null," +
|
||||
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -314,7 +314,7 @@ public class P2TaskStartMulIp {
|
|||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
|
||||
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":\"10\"," +
|
||||
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
|
||||
|
@ -337,7 +337,7 @@ public class P2TaskStartMulIp {
|
|||
* @param e the e
|
||||
* @param ipList the ip list
|
||||
*/
|
||||
private static void verifySucceed(ProtocolRespDTO<TaskStartMulRsp> v, ErrorCode e, String[] ipList) {
|
||||
private static void verifySucceed(ProtocolRespDTO<IpTaskStartMulRsp> v, ErrorCode e, String[] ipList) {
|
||||
Assert.assertNotNull(v);
|
||||
Assert.assertNotNull(v.getMsgContent());
|
||||
Assert.assertEquals((long) v.getCode(), e.getHttpCode());
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
|
|||
import com.dispose.pojo.dto.protocol.device.info.GetDeviceInfoRsp;
|
||||
import com.dispose.pojo.dto.protocol.device.manager.GetDeviceRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStartRsp;
|
||||
import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
|
||||
import com.dispose.test.common.QATestItem;
|
||||
|
@ -225,10 +225,10 @@ public class P3All {
|
|||
.urlPath("/task/startMulIp")
|
||||
.method(RequestMethod.POST)
|
||||
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":null}")
|
||||
.rspClass(TaskStartMulRsp.class)
|
||||
.rspClass(IpTaskStartMulRsp.class)
|
||||
.rspCode(ErrorCode.ERR_PARAMEXCEPTION)
|
||||
.autoLogin(true)
|
||||
.verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) P3All::verifyJsonExceptionResp)
|
||||
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) P3All::verifyJsonExceptionResp)
|
||||
.build(),
|
||||
|
||||
QATestItem.builder()
|
||||
|
|
Loading…
Reference in New Issue