@Test
    void verifyFileByExpression() throws Throwable {
        val mdFile = File.createTempFile("spsamlmetadata", ".xml");
        val content = IOUtils.toString(new ClassPathResource("sample-sp.xml").getInputStream(), StandardCharsets.UTF_8);
        FileUtils.writeStringToFile(mdFile, content, StandardCharsets.UTF_8);
        System.setProperty("FILE_EXPR_SP", mdFile.getCanonicalPath());

        val loader = buildCacheLoader();
        val service = new SamlRegisteredService();
        service.setName(RandomUtils.randomAlphabetic(4));
        service.setId(RandomUtils.nextLong());
        service.setServiceId("https://example.org/saml");
        service.setMetadataLocation("${#systemProperties['FILE_EXPR_SP']}");
        val key = new SamlRegisteredServiceCacheKey(service, new CriteriaSet());
        assertNotNull(loader.load(key));
    }
This is {@link SamlRegisteredServiceMetadataResolverCacheLoaderTests}.

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