@Test
    void verifyRegisteredServiceFromContextEvaluatedBeforeService() throws Throwable {
        val mgr = mock(ServicesManager.class);
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
        val callbackRegisteredService = CoreAuthenticationTestUtils.getRegisteredService("https://cas/idp/profile/SAML2/Callback");

        when(registeredService.getAccessStrategy().isServiceAccessAllowedForSso(registeredService)).thenReturn(false);
        when(callbackRegisteredService.getAccessStrategy().isServiceAccessAllowedForSso(registeredService)).thenReturn(true);

        when(mgr.findServiceBy(any(Service.class))).thenReturn(callbackRegisteredService);

        val context = MockRequestContext.create(applicationContext);

        val sso = new SingleSignOnProperties().setCreateSsoCookieOnRenewAuthn(false).setRenewAuthnEnabled(true);
        val strategy = new DefaultSingleSignOnParticipationStrategy(mgr, sso,
            mock(TicketRegistrySupport.class), mock(AuthenticationServiceSelectionPlan.class));
        WebUtils.putRegisteredService(context, registeredService);
        WebUtils.putServiceIntoFlowScope(context, CoreAuthenticationTestUtils.getWebApplicationService());
        WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication("casuser"), context);

        val ssoRequest = getSingleSignOnParticipationRequest(context);
        assertFalse(strategy.isParticipating(ssoRequest));

    }
This is {@link DefaultSingleSignOnParticipationStrategyTests}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-webflow/src/test/java/org/apereo/cas/web/flow/DefaultSingleSignOnParticipationStrategyTests.java