Hello experts,
we have a CAP Java Multitenant Project and we need to get information about all subscribed tenants during runtime.
I tried following snippet corresponding to the capire docs (https://cap.cloud.sap/docs/java/multitenancy#accessing-arbitrary-tenants) to iterate through all tenants. We tested it both locally and on BTP/CF and although we do have active subscriptions, readTenants() always returns a List with exactly one item which is null.
Can you provide assistance?
TenantProviderService tenantProvider = runtime.getServiceCatalog().getService(TenantProviderService.class, TenantProviderService.DEFAULT_NAME); List<String> tenants = tenantProvider.readTenants(); tenants.forEach(tenant -> { runtime.requestContext().privilegedUser().modifyUser(user -> user.setTenant(tenant)).run(context -> { ..... your code }); });