@Test
    void verifyWarningNoAttr() {
        val h = new OptionalWarningLdapAccountStateHandler();
        h.setDisplayWarningOnMatch(true);
        val response = mock(AuthenticationResponse.class);
        val config = new PasswordPolicyContext();
        config.setPasswordWarningNumberOfDays(5);
        val list = new ArrayList<MessageDescriptor>();
        h.handleWarning(
            new AccountState.DefaultWarning(ZonedDateTime.now(ZoneId.systemDefault()), 1),
            response, config, list);
        assertTrue(list.isEmpty());
        h.setWarnAttributeName("attribute");
        h.handleWarning(
            new AccountState.DefaultWarning(ZonedDateTime.now(ZoneId.systemDefault()), 1),
            response, config, list);
        assertTrue(list.isEmpty());
    }
This is {@link OptionalWarningLdapAccountStateHandlerTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-ldap-core/src/test/java/org/apereo/cas/authentication/support/OptionalWarningLdapAccountStateHandlerTests.java