@Test
    void verifyNoWarning() {
        val handler = new DefaultLdapAccountStateHandler();
        val response = mock(AuthenticationResponse.class);
        handler.setAttributesToErrorMap(Map.of("attr1", AccountLockedException.class));
        val entry = new LdapEntry();
        val accountState = mock(AccountState.class);
        when(response.getAccountState()).thenReturn(accountState);
        when(response.getLdapEntry()).thenReturn(entry);
        when(response.isSuccess()).thenReturn(Boolean.TRUE);
        assertDoesNotThrow(() -> {
            handler.handle(response, new PasswordPolicyContext());
        });

        val warning = mock(AccountState.Warning.class);
        when(accountState.getWarning()).thenReturn(warning);
        when(response.getAccountState()).thenReturn(accountState);
        assertDoesNotThrow(() -> {
            handler.handle(response, new PasswordPolicyContext());
        });
    }
This is {@link DefaultLdapAccountStateHandlerTests}.

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