REM:
1.修改DeviceNodeManagerControllerQATest,修复添加能力节点接口type为null时返回“设备已存在”的bug
This commit is contained in:
lijinxing 2020-05-26 18:45:00 +08:00
parent b64a3c221e
commit d224ceee02
2 changed files with 5 additions and 10 deletions

View File

@ -18,9 +18,9 @@ import lombok.NoArgsConstructor;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class NewNodeInfo {
private String id;
private int type;
private Integer type;
private String ipAddr;
private int areaCode;
private Integer areaCode;
private String name;
private String manufacturer;
private String model;

View File

@ -182,9 +182,8 @@ public class DeviceNodeManagerControllerQATest extends InitTestEnvironment {
public void a6_addDeviceNodeTypeNullExceptionTest() throws Exception {
String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587628826908," +
"\"msgContent\":\"{\\\"items\\\":[{\\\"areaCode\\\":0,\\\"ipAddr\\\":\\\"10.88.77.15\\\"," +
"\\\"manufacturer\\\":\\\"DPTech\\\",\\\"model\\\":\\\"UMC\\\"," +
"\\\"name\\\":\\\"中移杭研实验室清洗设备\\\",\\\"readme\\\":\\\"实验室测试设备\\\"," +
"\\\"type\\\":\\\"null\\\",\\\"version\\\":\\\"5.7.13\\\"}]}\"}";
"\\\"manufacturer\\\":\\\"DPTech\\\",\\\"model\\\":\\\"UMC\\\",\\\"name\\\":\\\"中移杭研实验室清洗设备\\\"," +
"\\\"readme\\\":\\\"实验室测试设备\\\",\\\"type\\\":null,\\\"version\\\":\\\"5.7.13\\\"}]}\"}";
String ret = mockMvc.perform(MockMvcRequestBuilders
.put("/manager/device")
@ -207,11 +206,7 @@ public class DeviceNodeManagerControllerQATest extends InitTestEnvironment {
Assert.assertNotNull(v.getMessage());
Assert.assertNotNull(v.getStatus());
if (v.getStatus() == 0) {
Assert.assertEquals(Long.valueOf(v.getStatus()), Long.valueOf(ErrorCode.ERR_OK.getCode()));
} else if (v.getStatus() == 20) {
Assert.assertEquals(Long.valueOf(v.getStatus()), Long.valueOf(ErrorCode.ERR_DEVICEEXISTS.getCode()));
}
Assert.assertEquals(Long.valueOf(v.getStatus()), Long.valueOf(ErrorCode.ERR_PARAMEXCEPTION.getCode()));
}
}