private void verifyAccountStatusFailure(final Exception ex, final Class<? extends Throwable> expected) throws Exception {
        val jwtProcessor = getConfigurableJWTProcessor("casuser");
        val provider = mock(CognitoIdentityProviderClient.class);

        when(provider.adminInitiateAuth(any(AdminInitiateAuthRequest.class))).thenThrow(ex);
        val creds = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser-exp-password", "Hell063!!");
        val handler = new AmazonCognitoAuthenticationAuthenticationHandler(mock(ServicesManager.class),
            PrincipalFactoryUtils.newPrincipalFactory(), provider, casProperties.getAuthn().getCognito(), jwtProcessor);
        assertThrows(expected, () -> handler.authenticate(creds, mock(Service.class)));
    }
This is {@link AmazonCognitoAuthenticationAuthenticationHandlerTests}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-aws-cognito-authentication/src/test/java/org/apereo/cas/authentication/AmazonCognitoAuthenticationAuthenticationHandlerTests.java