### Question:
XmlaRepositoryImpl implements Repository, UpdatableXMLAContainer { @Override public List<Map<String, Object>> getDatabases(RolapConnection connection) { final List<Map<String, Object>> propsList = new ArrayList<Map<String, Object>>(); for (DatabaseInfo dsInfo : getServerInfo().datasourceMap.values()) { propsList.add(dsInfo.properties); } return propsList; }  void setXmlaContentFinder(XmlaContentFinder xmlaContentFinder); void setLocator(CatalogLocator locator); void setCacheTimeout(long cacheTimeout); void setCatalogDelimiter(String catalogDelimiter); @Override List<String> getDatabaseNames(RolapConnection connection); @Override List<String> getCatalogNames(RolapConnection connection, String databaseName); @Override Map<String, RolapSchema> getRolapSchemas(RolapConnection connection, String databaseName, String catalogName); @Override List<Map<String, Object>> getDatabases(RolapConnection connection); @Override void clearCache(); @Override void shutdown(); @Override void updateXMLAConnection(MondrianXMLADefinition oldDef, MondrianXMLADefinition newDef); @Override OlapConnection getConnection(MondrianServer server, String databaseName, String catalogName, String roleName,
            Properties props);  }### Answer:
@Test public void getDatabases_ServerDoesNotContainsDataSource_ReturnEmptyList() { doReturn(null).when(xmlaContentFinder).getDataSources(); List<Map<String, Object>> databaseNames = xmlaRepository.getDatabases(any(RolapConnection.class)); assertEquals(0, databaseNames.size()); }
@Test public void getDatabases_ServerContainsOneDataSource_ReturnOneDataSourceProperties() { doReturn(getDataSourcesByTenantId(TEST_ORGANIZATION_1)).when(xmlaContentFinder).getDataSources(); List<Map<String, Object>> dataBasePropsList = xmlaRepository.getDatabases(any(RolapConnection.class)); assertEquals(1, dataBasePropsList.size()); assertEquals(dataBasePropsList.get(0).get("DataSourceName"), dataSource.name); assertEquals(dataBasePropsList.get(0).get("URL"), dataSource.url); assertEquals(dataBasePropsList.get(0).get("DataSourceInfo"), dataSource.name); assertEquals(dataBasePropsList.get(0).get("ProviderType"), dataSource.providerType); assertEquals(dataBasePropsList.get(0).get("AuthenticationMode"), dataSource.authenticationMode); }