### Question:
QueueService extends BaseService { public Map<String, Object> queryList(User loginUser) { Map<String, Object> result = new HashMap<>(); if (checkAdmin(loginUser, result)) { return result; } List<Queue> queueList = queueMapper.selectList(null); result.put(Constants.DATA_LIST, queueList); putMsg(result, Status.SUCCESS); return result; }  Map<String, Object> queryList(User loginUser); Map<String, Object> queryList(User loginUser, String searchVal, Integer pageNo, Integer pageSize); Map<String, Object> createQueue(User loginUser, String queue, String queueName); Map<String, Object> updateQueue(User loginUser, int id, String queue, String queueName); Result verifyQueue(String queue, String queueName);  }### Answer:
@Test public void testQueryList(){ Mockito.when(queueMapper.selectList(null)).thenReturn(getQueueList()); Map<String, Object> result = queueService.queryList(getLoginUser()); logger.info(result.toString()); List<Queue> queueList = (List<Queue>) result.get(Constants.DATA_LIST); Assert.assertTrue(CollectionUtils.isNotEmpty(queueList)); }
@Test public void testQueryListPage(){ IPage<Queue> page = new Page<>(1,10); page.setTotal(1L); page.setRecords(getQueueList()); Mockito.when(queueMapper.queryQueuePaging(Mockito.any(Page.class), Mockito.eq(queueName))).thenReturn(page); Map<String, Object> result = queueService.queryList(getLoginUser(),queueName,1,10); logger.info(result.toString()); PageInfo<Queue> pageInfo = (PageInfo<Queue>) result.get(Constants.DATA_LIST); Assert.assertTrue(CollectionUtils.isNotEmpty(pageInfo.getLists())); }