parent
393973d033
commit
ed34441ea6
|
@ -206,4 +206,43 @@ public class DisposeDeviceManagerTest {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A 4 gets pages of devices.
|
||||
*/
|
||||
@Test
|
||||
public void a4_getPagesOfDevices() {
|
||||
Integer startPage = 1;
|
||||
Integer pageSize = 5;
|
||||
|
||||
MulReturnType<PageInfo<DisposeDevice>, List<DisposeDevice>> ret = disposeDeviceManager.getPagesOfDevices(startPage, pageSize);
|
||||
|
||||
PageInfo<DisposeDevice> pageInfo = ret.getFirstParam();
|
||||
Assert.assertEquals(pageInfo.getPageNum(), (long) startPage);
|
||||
Assert.assertEquals(pageInfo.getPageSize(), (long) pageSize);
|
||||
|
||||
List<DisposeDevice> deviceList = ret.getSecondParam();
|
||||
|
||||
if (pageInfo.getList().size() > 0) {
|
||||
Assert.assertNotNull(deviceList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A 5 all dispose devices.
|
||||
*/
|
||||
@Test
|
||||
public void a5_getAllNormalDisposeDevices() throws JsonProcessingException {
|
||||
long normalNumber = disposeDeviceMapper.selectAll().stream().filter(v -> v.getStatus() == ObjectStatus.NORMAL).count();
|
||||
log.info("normalNumber-->{}", normalNumber);
|
||||
|
||||
if (normalNumber > 0) {
|
||||
List<DisposeDevice> disposeDeviceList = disposeDeviceManager.getAllNormalDisposeDevices();
|
||||
|
||||
log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(disposeDeviceList));
|
||||
|
||||
Assert.assertNotNull(disposeDeviceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue