@Test
    void verifyNoSub() throws Throwable {
        val jwtProcessor = getConfigurableJWTProcessor(StringUtils.EMPTY);
        val provider = mock(CognitoIdentityProviderClient.class);

        val authResult = AuthenticationResultType.builder().idToken("some-id-token").build();
        val result2 = AdminInitiateAuthResponse.builder().authenticationResult(authResult).build();
        when(provider.adminInitiateAuth(any(AdminInitiateAuthRequest.class))).thenReturn(result2);

        val creds = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser-ok", "Hell063!!");
        val handler = new AmazonCognitoAuthenticationAuthenticationHandler(mock(ServicesManager.class),
            PrincipalFactoryUtils.newPrincipalFactory(), provider, casProperties.getAuthn().getCognito(), jwtProcessor);
        assertThrows(FailedLoginException.class, () -> 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