@Test
    void verifyEntityIDFilter() {
        try (val mockFacade = mockStatic(SamlRegisteredServiceMetadataAdaptor.class)) {
            val service1 = getSamlRegisteredServiceFor(false, false, false, "urn:abc:def.+");
            service1.setEvaluationOrder(9);
            servicesManager.save(service1);
            mockFacade.when(() -> SamlRegisteredServiceMetadataAdaptor.get(any(), any(), anyString())).thenCallRealMethod();
            val entityID = "https://sp.testshib.org/shibboleth-sp";
            val service = webApplicationServiceFactory.createService(entityID);
            val samlRequest = EncodingUtils.encodeBase64(String.format(SAML_AUTHN_REQUEST1, entityID));
            service.setAttributes(Map.of(SamlProtocolConstants.PARAMETER_SAML_REQUEST, List.of(samlRequest)));

            val res1 = servicesManager.findServiceBy(service);
            assertNull(res1);

            mockFacade.verify(() -> SamlRegisteredServiceMetadataAdaptor.get(any(), eq(service1), anyString()), never());
            val service2 = getSamlRegisteredServiceFor(false, false, false, ".+");
            service2.setEvaluationOrder(10);
            servicesManager.save(service2);

            val res2 = servicesManager.findServiceBy(service);
            assertNotNull(res2);
            mockFacade.verify(() -> SamlRegisteredServiceMetadataAdaptor.get(any(), eq(service2), eq(entityID)));
        }
    }
Locator should not trigger metadata lookups when requested
entityID does not match pattern for service in question.
<p>
This test first verifies that, in the case of one service entry that does not match the requested entityID, no
metadata lookups are performed. It then verifies that, in the case of two service entries, one matching the
requested entityID, exactly one metadata lookup is performed.
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/services/SamlIdPServicesManagerRegisteredServiceLocatorTests.java