REM:
1. 重命名处置IP请求对象名称
This commit is contained in:
HuangXin 2020-10-09 11:21:05 +08:00
parent 39574b74a9
commit 79e2bcb585
9 changed files with 93 additions and 93 deletions

View File

@ -16,9 +16,9 @@ import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq;
import com.dispose.pojo.dto.protocol.task.GetDeviceTaskDetail; import com.dispose.pojo.dto.protocol.task.GetDeviceTaskDetail;
import com.dispose.pojo.dto.protocol.task.GetTaskDetail; import com.dispose.pojo.dto.protocol.task.GetTaskDetail;
import com.dispose.pojo.dto.protocol.task.GetTaskRsp; import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
import com.dispose.pojo.dto.protocol.task.IpTaskStartReq; import com.dispose.pojo.dto.protocol.task.IpTaskStartReq;
import com.dispose.pojo.dto.protocol.task.TaskStartRsp; import com.dispose.pojo.dto.protocol.task.IpTaskStartRsp;
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
import com.dispose.pojo.dto.protocol.task.TaskStopItem; import com.dispose.pojo.dto.protocol.task.TaskStopItem;
import com.dispose.pojo.dto.protocol.task.TaskStopRsp; import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
import com.dispose.pojo.entity.DeviceTask; import com.dispose.pojo.entity.DeviceTask;
@ -119,7 +119,7 @@ public class DisposeTaskController {
MulReturnType<ErrorCode, DisposeTask> ret = disposeTaskService.createTask(task); MulReturnType<ErrorCode, DisposeTask> ret = disposeTaskService.createTask(task);
// 设置返回消息 // 设置返回消息
TaskStartRsp rspInfo = TaskStartRsp.builder() IpTaskStartRsp rspInfo = IpTaskStartRsp.builder()
.disposeIp(task.getDisposeObject()) .disposeIp(task.getDisposeObject())
.build(); .build();
@ -150,7 +150,7 @@ public class DisposeTaskController {
@PostMapping("/startMulIp") @PostMapping("/startMulIp")
@ResponseBody @ResponseBody
@ApiOperation("启动处置任务") @ApiOperation("启动处置任务")
public ProtocolRespDTO<IpTaskStartMulRsp> startTaskMulIp(@Validated(ValidGroups.TaskStartMulReqValid.class) public ProtocolRespDTO<TaskStartMulRsp> startTaskMulIp(@Validated(ValidGroups.TaskStartMulReqValid.class)
@RequestBody ProtocolReqDTO<IpTaskStartReq> mr, @RequestBody ProtocolReqDTO<IpTaskStartReq> mr,
@NotNull @RequestHeader HttpHeaders headers) { @NotNull @RequestHeader HttpHeaders headers) {
IpTaskStartReq req = mr.getMsgContent(); IpTaskStartReq req = mr.getMsgContent();
@ -165,7 +165,7 @@ public class DisposeTaskController {
Integer flowBand = Optional.ofNullable(req.getFlowBandwidth()) Integer flowBand = Optional.ofNullable(req.getFlowBandwidth())
.orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH); .orElse(DisposeConfigValue.DEFAULT_DISPOSE_BANDWIDTH);
IpTaskStartMulRsp mulRsp = IpTaskStartMulRsp.builder() TaskStartMulRsp mulRsp = TaskStartMulRsp.builder()
.items(new ArrayList<>()) .items(new ArrayList<>())
.build(); .build();
@ -187,7 +187,7 @@ public class DisposeTaskController {
MulReturnType<ErrorCode, DisposeTask> ret = disposeTaskService.createTask(task); MulReturnType<ErrorCode, DisposeTask> ret = disposeTaskService.createTask(task);
// 设置返回消息 // 设置返回消息
TaskStartRsp rspInfo = TaskStartRsp.builder() IpTaskStartRsp rspInfo = IpTaskStartRsp.builder()
.disposeIp(ip) .disposeIp(ip)
.build(); .build();

View File

@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode;
@AllArgsConstructor @AllArgsConstructor
@JsonPropertyOrder({"taskId", "disposeIp", "expireTime", "status", "message"}) @JsonPropertyOrder({"taskId", "disposeIp", "expireTime", "status", "message"})
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class TaskStartRsp extends BaseIdResp { public class IpTaskStartRsp extends BaseIdResp {
/** /**
* The Dispose ip. * The Dispose ip.
*/ */

View File

@ -21,9 +21,9 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class IpTaskStartMulRsp extends BaseRespStatus { public class TaskStartMulRsp extends BaseRespStatus {
/** /**
* The Items. * The Items.
*/ */
List<TaskStartRsp> items; List<IpTaskStartRsp> items;
} }

View File

@ -14,9 +14,9 @@ import com.dispose.pojo.dto.protocol.base.ProtocolReqDTO;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq; import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq;
import com.dispose.pojo.dto.protocol.task.GetTaskRsp; import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp;
import com.dispose.pojo.dto.protocol.task.IpTaskStartReq; import com.dispose.pojo.dto.protocol.task.IpTaskStartReq;
import com.dispose.pojo.dto.protocol.task.TaskStartRsp; import com.dispose.pojo.dto.protocol.task.IpTaskStartRsp;
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
import com.dispose.pojo.dto.protocol.task.TaskStopItem; import com.dispose.pojo.dto.protocol.task.TaskStopItem;
import com.dispose.pojo.dto.protocol.task.TaskStopRsp; import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
import com.dispose.pojo.entity.DisposeTask; import com.dispose.pojo.entity.DisposeTask;
@ -129,8 +129,8 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
.getResponse() .getResponse()
.getContentAsString(); .getContentAsString();
ProtocolRespDTO<TaskStartRsp> rspInfo = objectMapper.readValue(ret, ProtocolRespDTO<IpTaskStartRsp> rspInfo = objectMapper.readValue(ret,
new TypeReference<ProtocolRespDTO<TaskStartRsp>>() { new TypeReference<ProtocolRespDTO<IpTaskStartRsp>>() {
}); });
verifyRespProtocol(rspInfo); verifyRespProtocol(rspInfo);
@ -190,8 +190,8 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
.getContentAsString(); .getContentAsString();
ProtocolRespDTO<TaskStartRsp> rspInfo = objectMapper.readValue(ret, ProtocolRespDTO<IpTaskStartRsp> rspInfo = objectMapper.readValue(ret,
new TypeReference<ProtocolRespDTO<TaskStartRsp>>() { new TypeReference<ProtocolRespDTO<IpTaskStartRsp>>() {
}); });
verifyRespProtocol(rspInfo); verifyRespProtocol(rspInfo);
@ -320,8 +320,8 @@ public class DisposeTaskControllerTest extends InitTestEnvironment {
log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(ret)); log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(ret));
ProtocolRespDTO<IpTaskStartMulRsp> rspInfo = objectMapper.readValue(ret, ProtocolRespDTO<TaskStartMulRsp> rspInfo = objectMapper.readValue(ret,
new TypeReference<ProtocolRespDTO<IpTaskStartMulRsp>>() { new TypeReference<ProtocolRespDTO<TaskStartMulRsp>>() {
}); });
verifyRespProtocol(rspInfo); verifyRespProtocol(rspInfo);

View File

@ -6,7 +6,7 @@ import com.dispose.common.SecurityConfigValue;
import com.dispose.pojo.dto.protocol.base.BaseRespStatus; import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.dto.protocol.task.GetTaskRsp; import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp; import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
import com.dispose.test.common.QATestItem; import com.dispose.test.common.QATestItem;
import com.dispose.test.common.TestPriority; import com.dispose.test.common.TestPriority;
import com.dispose.test.common.VerifyProtoRespCallback; import com.dispose.test.common.VerifyProtoRespCallback;
@ -38,10 +38,10 @@ public class CodeCoverage {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.\",\"192.168.50\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.\",\"192.168.50\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) CodeCoverage::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) CodeCoverage::verifyJsonExceptionResp)
.prepareCallback(c -> SecurityConfigValue.SECURITY_PROTOCOL_TYPE = ProtoCryptoType.CRYPTO_BASE64.getCode()) .prepareCallback(c -> SecurityConfigValue.SECURITY_PROTOCOL_TYPE = ProtoCryptoType.CRYPTO_BASE64.getCode())
.build(), .build(),

View File

@ -12,7 +12,7 @@ import com.dispose.pojo.dto.protocol.base.IdArraysReq;
import com.dispose.pojo.dto.protocol.device.manager.AddDeviceRsp; import com.dispose.pojo.dto.protocol.device.manager.AddDeviceRsp;
import com.dispose.pojo.dto.protocol.device.manager.CommDeviceListRsp; import com.dispose.pojo.dto.protocol.device.manager.CommDeviceListRsp;
import com.dispose.pojo.dto.protocol.task.GetTaskRsp; import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
import com.dispose.pojo.dto.protocol.task.TaskStartRsp; import com.dispose.pojo.dto.protocol.task.IpTaskStartRsp;
import com.dispose.pojo.dto.protocol.task.TaskStopRsp; import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
import com.dispose.pojo.entity.DisposeDevice; import com.dispose.pojo.entity.DisposeDevice;
import com.dispose.test.common.QATestItem; import com.dispose.test.common.QATestItem;
@ -239,10 +239,10 @@ public class P1All {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> { .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> {
Assert.assertNotNull(v); Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent()); Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long)v.getCode(), e.getHttpCode()); Assert.assertEquals((long)v.getCode(), e.getHttpCode());
@ -262,10 +262,10 @@ public class P1All {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\",\"disposeTime\":10," + "\"disposeIp\":\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\",\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> { .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> {
Assert.assertNotNull(v); Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent()); Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long)v.getCode(), e.getHttpCode()); Assert.assertEquals((long)v.getCode(), e.getHttpCode());

View File

@ -4,7 +4,7 @@ import com.dispose.common.ErrorCode;
import com.dispose.common.Helper; import com.dispose.common.Helper;
import com.dispose.pojo.dto.protocol.base.BaseRespStatus; import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.dto.protocol.task.TaskStartRsp; import com.dispose.pojo.dto.protocol.task.IpTaskStartRsp;
import com.dispose.test.common.QATestItem; import com.dispose.test.common.QATestItem;
import com.dispose.test.common.TestPriority; import com.dispose.test.common.TestPriority;
import com.dispose.test.common.VerifyProtoRespCallback; import com.dispose.test.common.VerifyProtoRespCallback;
@ -35,10 +35,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"192.168.51.2\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.51.2\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[-1]}}") "\"attackType\":[-1]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.51.2")) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.51.2"))
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -50,10 +50,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\",\"disposeTime\":10," + "\"disposeIp\":\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\",\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[-1]}}") "\"flowDirection\":2,\"attackType\":[-1]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "ABCD:EF01:2345" + .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "ABCD:EF01:2345" +
":6789:ABCD:EF01:2345:6789")) ":6789:ABCD:EF01:2345:6789"))
.build(), .build(),
@ -66,10 +66,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":0," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":0," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.2")) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.2"))
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -81,10 +81,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"192.168.50.3\",\"disposeTime\":10,\"flowDirection\":1," + "\"disposeIp\":\"192.168.50.3\",\"disposeTime\":10,\"flowDirection\":1," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.3")) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.3"))
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -96,10 +96,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":2," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":2," +
"\"disposeIp\":\"192.168.50.3\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.3\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[-1]}}") "\"attackType\":[-1]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.3")) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.3"))
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -111,10 +111,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":1," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":1," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[-1]}}") "\"attackType\":[-1]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.2")) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.2"))
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -126,10 +126,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":3," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":3," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[-1]}}") "\"attackType\":[-1]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.2")) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) (v, e, c) -> verifySucceed(v, e, "192.168.50.2"))
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -139,10 +139,10 @@ public class P2TaskStart {
.urlPath("/task/start") .urlPath("/task/start")
.method(RequestMethod.POST) .method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}") .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -154,10 +154,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":null," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":null," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -169,10 +169,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":\"0\"," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":\"0\"," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -183,10 +183,10 @@ public class P2TaskStart {
.method(RequestMethod.POST) .method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":null,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"disposeIp\":null,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -198,10 +198,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":192.168.50.2,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1," + "\"disposeIp\":192.168.50.2,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1," +
"2,3,4,5]}}") "2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -213,10 +213,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":null,\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":null,\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -228,10 +228,10 @@ public class P2TaskStart {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":\"192.168.50.2\",\"disposeTime\":\"10\",\"flowDirection\":2," + "\"disposeIp\":\"192.168.50.2\",\"disposeTime\":\"10\",\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>)P2TaskStart::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>)P2TaskStart::verifyJsonExceptionResp)
.build(), .build(),
}; };
@ -251,7 +251,7 @@ public class P2TaskStart {
* @param e the e * @param e the e
* @param ipAddr the ip addr * @param ipAddr the ip addr
*/ */
private static void verifySucceed(ProtocolRespDTO<TaskStartRsp> v, ErrorCode e, String ipAddr) { private static void verifySucceed(ProtocolRespDTO<IpTaskStartRsp> v, ErrorCode e, String ipAddr) {
String disposeIp = v.getMsgContent().getDisposeIp(); String disposeIp = v.getMsgContent().getDisposeIp();
Assert.assertNotNull(v); Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent()); Assert.assertNotNull(v.getMsgContent());

View File

@ -3,7 +3,7 @@ package com.dispose.test.testcase.qa.v200;
import com.dispose.common.ErrorCode; import com.dispose.common.ErrorCode;
import com.dispose.pojo.dto.protocol.base.BaseRespStatus; import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp; import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
import com.dispose.test.common.QATestItem; import com.dispose.test.common.QATestItem;
import com.dispose.test.common.TestPriority; import com.dispose.test.common.TestPriority;
import com.dispose.test.common.VerifyProtoRespCallback; import com.dispose.test.common.VerifyProtoRespCallback;
@ -37,10 +37,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -54,10 +54,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[-1]}}") "\"flowDirection\":2,\"attackType\":[-1]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -71,10 +71,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2}}") "\"flowDirection\":2}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -89,10 +89,10 @@ public class P2TaskStartMulIp {
"\"mulDisposeIp\":[\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"," + "\"mulDisposeIp\":[\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"," +
"\"ABCD:EF01:2345:6789:ABCD:EF01:2345:1234\"],\"disposeTime\":10,\"flowDirection\":2," + "\"ABCD:EF01:2345:6789:ABCD:EF01:2345:1234\"],\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789", "ABCD:EF01:2345:6789:ABCD:EF01:2345:1234" "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789", "ABCD:EF01:2345:6789:ABCD:EF01:2345:1234"
})) }))
.build(), .build(),
@ -107,10 +107,10 @@ public class P2TaskStartMulIp {
"\"mulDisposeIp\":[\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"," + "\"mulDisposeIp\":[\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"," +
"\"ABCD:EF01:2345:6789:ABCD:EF01:2345:1234\"],\"disposeTime\":10,\"flowDirection\":2," + "\"ABCD:EF01:2345:6789:ABCD:EF01:2345:1234\"],\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[-1]}}") "\"attackType\":[-1]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789", "ABCD:EF01:2345:6789:ABCD:EF01:2345:1234" "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789", "ABCD:EF01:2345:6789:ABCD:EF01:2345:1234"
})) }))
.build(), .build(),
@ -125,10 +125,10 @@ public class P2TaskStartMulIp {
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"," +
"\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"],\"disposeTime\":10,\"flowDirection\":2," + "\"ABCD:EF01:2345:6789:ABCD:EF01:2345:6789\"],\"disposeTime\":10,\"flowDirection\":2," +
"\"attackType\":[1,2,3,4,5]}}") "\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3","ABCD:EF01:2345:6789:ABCD:EF01:2345:6789" "192.168.50.4", "192.168.50.3","ABCD:EF01:2345:6789:ABCD:EF01:2345:6789"
})) }))
.build(), .build(),
@ -142,10 +142,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":0,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":0,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -159,10 +159,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":1,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":1,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -176,10 +176,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":2," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":2," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[-1]}}") "\"flowDirection\":2,\"attackType\":[-1]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -193,10 +193,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":1," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":1," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[-1]}}") "\"flowDirection\":2,\"attackType\":[-1]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -210,10 +210,10 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":3," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":3," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[-1]}}") "\"flowDirection\":2,\"attackType\":[-1]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_OK) .rspCode(ErrorCode.ERR_OK)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{ .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) (v, e, c) -> verifySucceed(v, e, new String[]{
"192.168.50.4", "192.168.50.3" "192.168.50.4", "192.168.50.3"
})) }))
.build(), .build(),
@ -225,7 +225,7 @@ public class P2TaskStartMulIp {
.urlPath("/task/startMulIp") .urlPath("/task/startMulIp")
.method(RequestMethod.POST) .method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}") .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -240,7 +240,7 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":null," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":null," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -255,7 +255,7 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":\"0\"," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":\"0\"," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":10," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -269,7 +269,7 @@ public class P2TaskStartMulIp {
.method(RequestMethod.POST) .method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":null,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"disposeIp\":null,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -284,7 +284,7 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"disposeIp\":192.168.50.2,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1," + "\"disposeIp\":192.168.50.2,\"disposeTime\":10,\"flowDirection\":2,\"attackType\":[1," +
"2,3,4,5]}}") "2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -299,7 +299,7 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":null," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":null," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -314,7 +314,7 @@ public class P2TaskStartMulIp {
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," + .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":{\"type\":0," +
"\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":\"10\"," + "\"mulDisposeIp\":[\"192.168.50.4\",\"192.168.50.3\"],\"disposeTime\":\"10\"," +
"\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}") "\"flowDirection\":2,\"attackType\":[1,2,3,4,5]}}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp) .verifyCallback(P2TaskStartMulIp::verifyJsonExceptionResp)
@ -337,7 +337,7 @@ public class P2TaskStartMulIp {
* @param e the e * @param e the e
* @param ipList the ip list * @param ipList the ip list
*/ */
private static void verifySucceed(ProtocolRespDTO<IpTaskStartMulRsp> v, ErrorCode e, String[] ipList) { private static void verifySucceed(ProtocolRespDTO<TaskStartMulRsp> v, ErrorCode e, String[] ipList) {
Assert.assertNotNull(v); Assert.assertNotNull(v);
Assert.assertNotNull(v.getMsgContent()); Assert.assertNotNull(v.getMsgContent());
Assert.assertEquals((long) v.getCode(), e.getHttpCode()); Assert.assertEquals((long) v.getCode(), e.getHttpCode());

View File

@ -7,8 +7,8 @@ import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO;
import com.dispose.pojo.dto.protocol.device.info.GetDeviceInfoRsp; import com.dispose.pojo.dto.protocol.device.info.GetDeviceInfoRsp;
import com.dispose.pojo.dto.protocol.device.manager.GetDeviceRsp; import com.dispose.pojo.dto.protocol.device.manager.GetDeviceRsp;
import com.dispose.pojo.dto.protocol.task.GetTaskRsp; import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
import com.dispose.pojo.dto.protocol.task.IpTaskStartMulRsp; import com.dispose.pojo.dto.protocol.task.IpTaskStartRsp;
import com.dispose.pojo.dto.protocol.task.TaskStartRsp; import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
import com.dispose.pojo.dto.protocol.task.TaskStopRsp; import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
import com.dispose.test.common.QATestItem; import com.dispose.test.common.QATestItem;
import com.dispose.test.common.TestPriority; import com.dispose.test.common.TestPriority;
@ -212,10 +212,10 @@ public class P3All {
.urlPath("/task/start") .urlPath("/task/start")
.method(RequestMethod.POST) .method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":null}") .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":null}")
.rspClass(TaskStartRsp.class) .rspClass(IpTaskStartRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<TaskStartRsp>) P3All::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<IpTaskStartRsp>) P3All::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()
@ -225,10 +225,10 @@ public class P3All {
.urlPath("/task/startMulIp") .urlPath("/task/startMulIp")
.method(RequestMethod.POST) .method(RequestMethod.POST)
.caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":null}") .caseJsonValue("{\"ver\":3,\"cryptoType\":0,\"timeStamp\":1598597142580,\"msgContent\":null}")
.rspClass(IpTaskStartMulRsp.class) .rspClass(TaskStartMulRsp.class)
.rspCode(ErrorCode.ERR_PARAMEXCEPTION) .rspCode(ErrorCode.ERR_PARAMEXCEPTION)
.autoLogin(true) .autoLogin(true)
.verifyCallback((VerifyProtoRespCallback<IpTaskStartMulRsp>) P3All::verifyJsonExceptionResp) .verifyCallback((VerifyProtoRespCallback<TaskStartMulRsp>) P3All::verifyJsonExceptionResp)
.build(), .build(),
QATestItem.builder() QATestItem.builder()