@Test
    void verifyCacheKeyByMetadataLocation() {
        val entityId = "https://carmenwiki.osu.edu/shibboleth";

        val criteriaSet = new CriteriaSet();
        criteriaSet.add(new EntityIdCriterion(entityId));
        criteriaSet.add(new EntityRoleCriterion(SPSSODescriptor.DEFAULT_ELEMENT_NAME));

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

        val results = new SamlRegisteredServiceCacheKey(service, criteriaSet);
        assertNotNull(results.getId());
        assertNotNull(results.getRegisteredService());
        assertNotNull(results.getCriteriaSet());
        assertEquals(results.getCacheKey(), service.getMetadataLocation());
    }
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