@Audit(action = AuditableActions.SAML2_METADATA_RESOLUTION,
        actionResolverName = AuditActionResolvers.SAML2_METADATA_RESOLUTION_ACTION_RESOLVER,
        resourceResolverName = AuditResourceResolvers.SAML2_METADATA_RESOLUTION_RESOURCE_RESOLVER)
    @Override
    public Collection<? extends MetadataResolver> resolve(final SamlRegisteredService service, final CriteriaSet criteriaSet) {
        return FunctionUtils.doAndHandle(() -> {
            val metadataLocation = SpringExpressionLanguageValueResolver.getInstance().resolve(service.getMetadataLocation());
            LOGGER.info("Loading SAML metadata via [{}]", metadataLocation);
            val metadataResource = ResourceUtils.getResourceFrom(metadataLocation);
            val args = new Object[]{service, this.configBean, this.samlIdPProperties, criteriaSet, LOGGER};
            val scriptFactory = ExecutableCompiledScriptFactory.getExecutableCompiledScriptFactory();
            val metadataResolver = scriptFactory.fromResource(metadataResource).execute(args, MetadataResolver.class, true);
            return CollectionUtils.wrap(metadataResolver);
        }, e -> new ArrayList<MetadataResolver>()).get();
    }
This is {@link GroovyResourceMetadataResolver}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/GroovyResourceMetadataResolver.java