@Override
    protected void doHealthCheck(final Health.Builder builder) {
        val samlServices = servicesManager.findServiceBy(SamlRegisteredService.class::isInstance);
        val availableResolvers = metadataResolutionPlan.getRegisteredMetadataResolvers();
        LOGGER.trace("There are [{}] metadata resolver(s) available in the chain", availableResolvers.size());

        builder.up();
        builder.withDetail("name", getClass().getSimpleName());
        var count = new AtomicInteger();
        samlServices
            .stream()
            .map(SamlRegisteredService.class::cast)
            .forEach(service -> {
                val map = new LinkedHashMap<String, Object>();
                map.put("name", service.getName());
                map.put("id", service.getId());
                map.put("metadataLocation", service.getMetadataLocation());
                map.put("serviceId", service.getServiceId());
                val availability = availableResolvers
                    .stream()
                    .filter(Objects::nonNull)
                    .filter(r -> r.supports(service))
                    .anyMatch(r -> r.isAvailable(service));
                map.put("availability", BooleanUtils.toStringYesNo(availability));
                builder.withDetail(service.getName(), map);
                if (!availability) {
                    LOGGER.debug("No metadata resolver is available for service [{}]", service.getName());
                    count.getAndIncrement();
                }
            });
        if (!samlServices.isEmpty() && count.intValue() == samlServices.size()) {
            builder.down();
        }
    }
This is {@link SamlRegisteredServiceMetadataHealthIndicator}.
Only need 1 valid resolver for metadata to be 'available'.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/SamlRegisteredServiceMetadataHealthIndicator.java