@Test
    void verifyPrincipalAttributes() throws Throwable {
        val input = new RequiredAttributesAuthenticationPolicy(Map.of(
            "givenName", "\\w+[0-9]", "name", "[0-9]-\\w+-cas"));
        val authn = CoreAuthenticationTestUtils.getAuthentication(
            CoreAuthenticationTestUtils.getPrincipal(Map.of("givenName", List.of("cas", "cas-88"), "name", List.of("1-hello-cas"))));
        assertTrue(input.isSatisfiedBy(authn, mock(ConfigurableApplicationContext.class)).isSuccess());
    }
This is {@link RequiredAttributesAuthenticationPolicyTests}.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core-authentication/src/test/java/org/apereo/cas/authentication/policy/RequiredAttributesAuthenticationPolicyTests.java