### Question:
XmlaContentFinderImpl implements XmlaContentFinder { public DataSourcesConfig.Catalog createCatalogConfigOutOfDefinition(MondrianXMLADefinition def) { DataSourcesConfig.Catalog catalog = new DataSourcesConfig.Catalog(); catalog.dataSourceInfo = "Provider=" + providerName + ";DataSource=" + def.getCatalog() + ";"; String tenantId = ""; Tenant tenant = tenantService.getTenantBasedOnRepositoryUri(null, def.getURIString()); if (tenant != null) { tenantId = tenant.getId(); catalog.dataSourceInfo += TENANT_ID + tenantId + ";"; } catalog.name = def.getCatalog(); catalog.definition = tenantId; return catalog; }  void setRepository(RepositoryService repository); void setTenantService(TenantService tenantService); void setOlapConnectionService(OlapConnectionService olapConnectionService); OlapConnectionService getOlapConnectionService(); OlapManagementService getOlapManagementService(); RepositoryService getRepository(); DataSourcesConfig.DataSources getDataSources(); DataSourcesConfig.Catalog createCatalogConfigOutOfDefinition(MondrianXMLADefinition def); Properties getMondrianConnectionProperties(Map<String, Object> dataSourceProperties, String role); MondrianConnection lookupXmlaConnection(ExecutionContext context, String dataSourceInfo);  }### Answer:
@Test public void createCatalogConfigOutOfDefinition_ServerContainsRequiredCatalog_ReturnCatalog() { String catalogName = catalogs.get(0); String resourceUri = resourceUris.get(0); String tenantId = tenants.get(0); mockMondrianXMLADefinition(catalogName, resourceUri); mockTenantService(tenantId, resourceUri); DataSourcesConfig.Catalog catalog = xmlaContentFinder. createCatalogConfigOutOfDefinition(mockMondrianXMLADefinition(catalogName, resourceUri)); assertCatalog(catalog, catalogName, tenantId); }