@Test
        void verifyResolverResolvesFailsAccess() {
            val resolver = getMetadataResolver();
            try (val webServer = new MockWebServer(new ClassPathResource("sample-metadata.xml"))) {
                webServer.start();
                val service = new SamlRegisteredService();
                service.setName(RandomUtils.randomAlphabetic(12));
                service.setId(RandomUtils.nextInt());
                service.setMetadataLocation("http://localhost:%s".formatted(webServer.getPort()));
                service.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy(false, false));
                assertThrows(SamlException.class, () -> resolver.resolve(service));
            }
        }
This is {@link UrlResourceMetadataResolverTests}.

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