@Test
    @SuppressWarnings("JdkObsolete")
    void verifyOKWithMappedAttributes() throws Throwable {
        val jwtProcessor = getConfigurableJWTProcessor("casuser");
        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 userResult1 = AdminGetUserResponse.builder()
                .username("casuser")
                .userStatus("OK")
                .userCreateDate(Instant.now(Clock.systemUTC()))
                .userLastModifiedDate(Instant.now(Clock.systemUTC()))
                .userAttributes(List.of(AttributeType.builder().name("custom:netid").value("cas789").build()))
                .build();

        when(provider.adminGetUser(any(AdminGetUserRequest.class))).thenReturn(userResult1);
        val creds = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser-ok", "Hell063!!");

        val handler = new AmazonCognitoAuthenticationAuthenticationHandler(mock(ServicesManager.class),
                PrincipalFactoryUtils.newPrincipalFactory(), provider,
                casProperties.getAuthn().getCognito(), jwtProcessor);
        val result = handler.authenticate(creds, mock(Service.class));
        assertEquals("cas789", result.getPrincipal().getAttributes().get("netid").getFirst());
    }
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