@Test
    void verifyRegisteredServiceWithValidSso() throws Throwable {
        val mgr = mock(ServicesManager.class);
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
        when(registeredService.getAccessStrategy().isServiceAccessAllowedForSso(registeredService)).thenReturn(true);
        when(registeredService.getSingleSignOnParticipationPolicy()).thenReturn(new DefaultRegisteredServiceSingleSignOnParticipationPolicy());
        when(mgr.findServiceBy(any(Service.class))).thenReturn(registeredService);

        val context = MockRequestContext.create(applicationContext);

        val tgt = new MockTicketGrantingTicket("casuser");
        val sso = new SingleSignOnProperties();
        val ticketRegistrySupport = mock(TicketRegistrySupport.class);
        when(ticketRegistrySupport.getTicket(anyString())).thenReturn(tgt);
        val strategy = new DefaultSingleSignOnParticipationStrategy(mgr, sso,
            ticketRegistrySupport, mock(AuthenticationServiceSelectionPlan.class));

        WebUtils.putRegisteredService(context, registeredService);
        WebUtils.putServiceIntoFlowScope(context, CoreAuthenticationTestUtils.getWebApplicationService());
        WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication("casuser"), context);
        WebUtils.putTicketGrantingTicketInScopes(context, tgt);

        val ssoRequest = getSingleSignOnParticipationRequest(context);
        assertTrue(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