### Question:
XmlaRepositoryImpl implements Repository, UpdatableXMLAContainer { @Override public List<String> getCatalogNames(RolapConnection connection, String databaseName) { return new ArrayList<String>(getServerInfo().getDatabaseInfo(databaseName).getCatalogAsMap().keySet()); }  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(expected = RuntimeException.class) public void getCatalogNames_ServerDoesContainsOneDataSource_ThrowException() { doReturn(null).when(xmlaContentFinder).getDataSources(); xmlaRepository.getCatalogNames(null, "incorrectDataBaseName"); }
@Test(expected = RuntimeException.class) public void getCatalogNames_ServerDoesNotContainsDataSource_ThrowException() { doReturn(null).when(xmlaContentFinder).getDataSources(); xmlaRepository.getCatalogNames(any(RolapConnection.class), any(String.class)); }