### Question:
DataSourceService extends BaseService { public Map<String, Object> queryDataSourceList(User loginUser, Integer type) { Map<String, Object> result = new HashMap<>(); List<DataSource> datasourceList; if (isAdmin(loginUser)) { datasourceList = dataSourceMapper.listAllDataSourceByType(type); } else { datasourceList = dataSourceMapper.queryDataSourceByType(loginUser.getId(), type); } result.put(Constants.DATA_LIST, datasourceList); putMsg(result, Status.SUCCESS); return result; }  Map<String, Object> createDataSource(User loginUser, String name, String desc, DbType type, String parameter); Map<String, Object> updateDataSource(int id, User loginUser, String name, String desc, DbType type, String parameter); Map<String, Object> queryDataSource(int id); Map<String, Object> queryDataSourceListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize); Map<String, Object> queryDataSourceList(User loginUser, Integer type); Result verifyDataSourceName(String name); boolean checkConnection(DbType type, String parameter); boolean connectionTest(int id); String buildParameter(DbType type, String host,
                                 String port, String database, String principal, String userName,
                                 String password, DbConnectType connectType, String other); @Transactional(rollbackFor = RuntimeException.class) Result delete(User loginUser, int datasourceId); Map<String, Object> unauthDatasource(User loginUser, Integer userId); Map<String, Object> authedDatasource(User loginUser, Integer userId); static final String NAME; static final String NOTE; static final String TYPE; static final String HOST; static final String PORT; static final String PRINCIPAL; static final String DATABASE; static final String USER_NAME; static final String OTHER; }### Answer:
@Test public void queryDataSourceListTest() { User loginUser = new User(); loginUser.setUserType(UserType.GENERAL_USER); Map<String, Object> map = dataSourceService.queryDataSourceList(loginUser, DbType.MYSQL.ordinal()); Assert.assertEquals(Status.SUCCESS, map.get(Constants.STATUS)); }