@Test
    void verifyRetryableOp() throws Throwable {

        val service = new SamlRegisteredService();
        service.setName("Example");
        service.setId(1000);
        service.setServiceId(".+");
        service.setMetadataLocation("classpath:sample-sp.xml");

        val resolver = getResolver("PT5S");
        val criteriaSet1 = getCriteriaFor("https://carmenwiki.osu.edu/shibboleth");
        assertNotNull(resolver.resolve(service, criteriaSet1));

        val criteriaSet2 = getCriteriaFor("unknown-service-provider");
        assertThrows(SamlException.class, () -> resolver.resolve(service, criteriaSet2));

        assertFalse(resolver.resolveIfPresent(service, criteriaSet1).isPresent());
        resolver.invalidate();
    }
This is {@link SamlRegisteredServiceDefaultCachingMetadataResolverTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-saml-idp-metadata/src/test/java/org/apereo/cas/support/saml/services/idp/metadata/cache/SamlRegisteredServiceDefaultCachingMetadataResolverTests.java