@Test
    void verifyWithCallback() throws Throwable {
        val callbackUrl = "http://localhost:8443/cas" + WSFederationConstants.ENDPOINT_FEDERATION_REQUEST_CALLBACK;
        
        val service0 = RegisteredServiceTestUtils.getRegisteredService(callbackUrl + ".*");
        service0.setEvaluationOrder(0);

        val service1 = getWsFederationRegisteredService("application1", "CAS");
        service1.setEvaluationOrder(100);

        val service2 = getWsFederationRegisteredService(".*", "CAS");
        service2.setEvaluationOrder(1000);

        val candidateServices = CollectionUtils.wrapList(service0, service1, service2);
        servicesManager.save(candidateServices.toArray(new RegisteredService[0]));

        Collections.sort(candidateServices);

        val url = new URIBuilder(callbackUrl + '?'
            + WSFederationConstants.WTREALM + "=CAS&" + WSFederationConstants.WREPLY + "=application1");
        val request = new MockHttpServletRequest();
        request.setRequestURI(callbackUrl);
        url.getQueryParams().forEach(param -> request.addParameter(param.getName(), param.getValue()));
        RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request, new MockHttpServletResponse()));
        val service = webApplicationServiceFactory.createService(url.toString());
        val result = servicesManager.findServiceBy(service);
        assertEquals(service1, result);
    }
This is {@link WsFederationServicesManagerRegisteredServiceLocatorTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-ws-idp/src/test/java/org/apereo/cas/ws/idp/services/WsFederationServicesManagerRegisteredServiceLocatorTests.java