diff --git a/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java b/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java index 6c0092ec..dc33b9c1 100644 --- a/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java +++ b/src/test/java/com/dispose/test/manager/DisposeDeviceManagerTest.java @@ -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, List> ret = disposeDeviceManager.getPagesOfDevices(startPage, pageSize); + + PageInfo pageInfo = ret.getFirstParam(); + Assert.assertEquals(pageInfo.getPageNum(), (long) startPage); + Assert.assertEquals(pageInfo.getPageSize(), (long) pageSize); + + List 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 disposeDeviceList = disposeDeviceManager.getAllNormalDisposeDevices(); + + log.debug(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(disposeDeviceList)); + + Assert.assertNotNull(disposeDeviceList); + } + } }