@Test
    void verifySsoParticipationByPrincipalAttribute() {
        val state = mock(AuthenticationAwareTicket.class);
        when(state.getAuthentication()).thenReturn(CoreAuthenticationTestUtils.getAuthentication("casuser", Map.of("cn", List.of("1/2/3"))));
        val chain = new ChainingRegisteredServiceSingleSignOnParticipationPolicy();
        val policy = new AttributeBasedRegisteredServiceSingleSignOnParticipationPolicy();
        policy.setAttributes(Map.of("cn", List.of("\\d/\\d/\\d")));
        chain.addPolicy(policy);
        assertTrue(chain.shouldParticipateInSso(RegisteredServiceTestUtils.getRegisteredService(), state));
    }
This is {@link ChainingRegisteredServiceSingleSignOnParticipationPolicyTests}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/ChainingRegisteredServiceSingleSignOnParticipationPolicyTests.java