@Test
    void verifyNoReleaseCredential() {
        val policy = new DefaultAuthenticationAttributeReleasePolicy("authnContext");
        policy.getOnlyReleaseAttributes().add(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_AUTHENTICATION_DATE);
        val service = CoreAuthenticationTestUtils.getRegisteredService();
        val attrPolicy = new ReturnAllowedAttributeReleasePolicy();
        attrPolicy.setAuthorizedToReleaseCredentialPassword(false);
        when(service.getAttributeReleasePolicy()).thenReturn(attrPolicy);
        val authentication = CoreAuthenticationTestUtils.getAuthentication(
            Map.of(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL, List.of("Password")));
        assertFalse(policy.getAuthenticationAttributesForRelease(authentication,
            mock(Assertion.class), Map.of(), service).isEmpty());
    }
This is {@link DefaultAuthenticationAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/authentication/DefaultAuthenticationAttributeReleasePolicyTests.java