public static List<TenantSecretStore> populateExternalId(SecretStore secretStore, TenantName tenant, SystemName system, List<TenantSecretStore> tenantSecretStores) {
        return tenantSecretStores.stream()
                .map(tenantSecretStore -> {
                    var secretName = secretName(tenant, system, tenantSecretStore.getName());
                    try {
                        String secret = secretStore.getSecret(secretName);
                        if (secret == null)
                            throw new InvalidApplicationException("No secret found in secret store for " + secretName);
                        return tenantSecretStore.withExternalId(secret);
                    } catch (SecretNotFoundException e) {
                        throw new InvalidApplicationException("Could not find externalId for secret store: %s".formatted(tenantSecretStore.getName()));
                    }
                })
                .toList();
    }
@Test
    public void reports_application_package_error_when_external_id_not_found() {
        InvalidApplicationException exception = assertThrows(InvalidApplicationException.class, () -> SecretStoreExternalIdRetriever.populateExternalId(secretStore, tenantName, SystemName.PublicCd, List.of(tenantSecretStore)));
        assertEquals("Could not find externalId for secret store: name", exception.getMessage());
    }