### Question:
MonitorService extends BaseService { public Map<String,Object> queryDatabaseState(User loginUser) { Map<String, Object> result = new HashMap<>(); List<MonitorRecord> monitorRecordList = monitorDBDao.queryDatabaseState(); result.put(Constants.DATA_LIST, monitorRecordList); putMsg(result, Status.SUCCESS); return result; }  Map<String,Object> queryDatabaseState(User loginUser); Map<String,Object> queryMaster(User loginUser); Map<String,Object> queryZookeeperState(User loginUser); Map<String,Object> queryWorker(User loginUser); List<Server> getServerListFromZK(boolean isMaster);  }### Answer:
@Test public void testQueryDatabaseState(){ Mockito.when(monitorDBDao.queryDatabaseState()).thenReturn(getList()); Map<String,Object> result = monitorService.queryDatabaseState(null); logger.info(result.toString()); Assert.assertEquals(Status.SUCCESS,result.get(Constants.STATUS)); List<MonitorRecord> monitorRecordList = (List<MonitorRecord>) result.get(Constants.DATA_LIST); Assert.assertTrue(CollectionUtils.isNotEmpty(monitorRecordList)); }