@Override public String listjson() { Pager<AccountInMaster> pager = accountInService.findPager(objectQuery); Pager<AccountInMaster> pms = new Pager<AccountInMaster>(pager.getPageNo(), pager.getPageSize(), pager.getTotalRows()); for (AccountInMaster master : pager.getRows()) { pms.getRows().add((AccountInMaster) master.toDisp(false)); } actionJsonResult = new ActionJsonResult(pms); return JSONALL; }
@Test public void testFindPager() { Pager<PeriodStock> pager = periodStockService.findPager(new ObjectQuery()); System.out.println("pageNo:" + pager.getPageNo()); System.out.println("pageSize:" + pager.getPageSize()); System.out.println("datas:" + pager.getRows()); System.out.println("totalPages:" + pager.getTotalPages()); Assert.assertNotNull(pager); Assert.assertTrue(pager.getRows().size() > 0); }