@Test
    void verifyCacheKeyDynamicMetadata() {
        val criteriaSet = new CriteriaSet();
        val entityIdCriterion = new EntityIdCriterion("https://carmenwiki.osu.edu/shibboleth");
        criteriaSet.add(entityIdCriterion);
        criteriaSet.add(new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));

        val service = new SamlRegisteredService();
        service.setName("Example");
        service.setId(1000);
        service.setServiceId(".+");
        service.setMetadataLocation("https://mdq.something.net/entities/{0}");

        val result1 = new SamlRegisteredServiceCacheKey(service, criteriaSet);
        assertNotNull(result1.getId());
        assertNotNull(result1.toString());
        assertEquals(entityIdCriterion.getEntityId(), result1.getCacheKey());

        val result2 = new SamlRegisteredServiceCacheKey(service, criteriaSet);
        assertEquals(result1, result2);
    }
This is {@link SamlRegisteredServiceCacheKeyTests}.

@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/SamlRegisteredServiceCacheKeyTests.java