parent
83d19736cf
commit
92d695b323
|
@ -281,7 +281,7 @@ public class DeviceNodeManagerControllerTest extends InitTestEnvironment {
|
||||||
.header("Authorization", GlobalVar.STRING_HTTP_AUTH_HEAD + getLogToken())
|
.header("Authorization", GlobalVar.STRING_HTTP_AUTH_HEAD + getLogToken())
|
||||||
.content(objectMapper.writeValueAsString(reqInfo)))
|
.content(objectMapper.writeValueAsString(reqInfo)))
|
||||||
.andDo(print()).andExpect(status().isOk())
|
.andDo(print()).andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$.code").value(525))
|
.andExpect(jsonPath("$.code").value(ErrorCode.ERR_OK.getHttpCode()))
|
||||||
.andReturn()
|
.andReturn()
|
||||||
.getResponse()
|
.getResponse()
|
||||||
.getContentAsString();
|
.getContentAsString();
|
||||||
|
|
|
@ -168,8 +168,6 @@ public class TaskControllerTest extends InitTestEnvironment {
|
||||||
Assert.assertNotEquals(Long.valueOf(startTaskRsp.getStatus()), Long.valueOf(ErrorCode.ERR_OK.getCode()));
|
Assert.assertNotEquals(Long.valueOf(startTaskRsp.getStatus()), Long.valueOf(ErrorCode.ERR_OK.getCode()));
|
||||||
Assert.assertNotEquals(startTaskRsp.getMessage(), ErrorCode.ERR_OK.getMsg());
|
Assert.assertNotEquals(startTaskRsp.getMessage(), ErrorCode.ERR_OK.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.sleep(1000 * 300);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -135,24 +135,20 @@ public class DisposeDeviceMapperTest extends InitTestEnvironment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* T 0 del dispose device by ip.
|
|
||||||
*
|
|
||||||
* @throws JsonProcessingException the json processing exception
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
public void t0_delDisposeDeviceByIp() throws JsonProcessingException {
|
|
||||||
String ipAddr = "10.88.77.15";
|
|
||||||
disposeDeviceMapper.delDisposeDeviceByIp(ipAddr);
|
|
||||||
|
|
||||||
List<DisposeDevice> dp = disposeDeviceMapper.selectAll();
|
// @Test
|
||||||
log.info(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(dp));
|
// public void t0_delDisposeDeviceByIp() throws JsonProcessingException {
|
||||||
dp.forEach(v -> {
|
// String ipAddr = "10.88.77.15";
|
||||||
if (v.getIpAddr().equals(ipAddr)) {
|
// disposeDeviceMapper.delDisposeDeviceByIp(ipAddr);
|
||||||
Assert.fail();
|
//
|
||||||
}
|
// List<DisposeDevice> dp = disposeDeviceMapper.selectAll();
|
||||||
});
|
// log.info(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(dp));
|
||||||
}
|
// dp.forEach(v -> {
|
||||||
|
// if (v.getIpAddr().equals(ipAddr)) {
|
||||||
|
// Assert.fail();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* T 6 get dispose device by ip is not existed.
|
* T 6 get dispose device by ip is not existed.
|
||||||
|
|
|
@ -100,16 +100,13 @@ public class DisposeTaskMapperTest extends InitTestEnvironment {
|
||||||
Assert.assertNotNull(disposeTaskMapper.getTaskById(taskData.getId()));
|
Assert.assertNotNull(disposeTaskMapper.getTaskById(taskData.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// @Test
|
||||||
* Remove task test.
|
// public void t99_removeTaskTest() {
|
||||||
*/
|
// disposeTaskMapper.selectAll().forEach(v -> {
|
||||||
@Test
|
// disposeTaskMapper.removeTaskById(v.getId());
|
||||||
public void t99_removeTaskTest() {
|
// Assert.assertNull(disposeTaskMapper.getTaskById(v.getId()));
|
||||||
disposeTaskMapper.selectAll().forEach(v -> {
|
// });
|
||||||
disposeTaskMapper.removeTaskById(v.getId());
|
// }
|
||||||
Assert.assertNull(disposeTaskMapper.getTaskById(v.getId()));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* T 2 change task status test.
|
* T 2 change task status test.
|
||||||
|
|
|
@ -41,8 +41,7 @@ public class DisposeNodeManagerTest extends InitTestEnvironment {
|
||||||
* The Un used ip addr.
|
* The Un used ip addr.
|
||||||
*/
|
*/
|
||||||
private final String[] unUsedIpAddr = new String[]{"192.168.3.1", "192.168.3.6",
|
private final String[] unUsedIpAddr = new String[]{"192.168.3.1", "192.168.3.6",
|
||||||
"192.168.6.8", "192.168.6.10",
|
"192.168.6.8", "192.168.6.10", "255.255.255.255"};
|
||||||
"0.0.0.0", "255.255.255.255"};
|
|
||||||
/**
|
/**
|
||||||
* The Object mapper.
|
* The Object mapper.
|
||||||
*/
|
*/
|
||||||
|
@ -86,7 +85,7 @@ public class DisposeNodeManagerTest extends InitTestEnvironment {
|
||||||
log.info("Test:{} --> {}", s, objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(
|
log.info("Test:{} --> {}", s, objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(
|
||||||
disposeNodeManager.getDisposeDevice(s, DeviceCapacity.CLEANUP)
|
disposeNodeManager.getDisposeDevice(s, DeviceCapacity.CLEANUP)
|
||||||
));
|
));
|
||||||
Assert.assertNull(disposeNodeManager.getDisposeDevice(s, DeviceCapacity.CLEANUP));
|
Assert.assertEquals(disposeNodeManager.getDisposeDevice(s, DeviceCapacity.CLEANUP).size(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue