kotlin/services/cognito/README.md
This README discusses how to run and test the AWS SDK for Kotlin examples for Amazon Cognito.
Amazon Cognito is a simple user identity and data synchronization service that helps you securely manage and synchronize app data for your users across their mobile devices.
The following examples use the CognitoIdentityClient object:
The following examples use the CognitoIdentityProviderClient object:
The following example is an Amazon Cognito scenario:
IMPORTANT
The Kotlin examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the AWS Pricing page for details about the charges you can expect for a given service and operation.
Some of these examples perform destructive operations on AWS resources, such as deleting a user pool. Be very careful when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples.
To run these examples, you can setup your development environment to use Gradle to configure and build AWS SDK for Kotlin projects. For more information, see Get started with the AWS SDK for Kotlin.
You can test the Kotlin code examples for Amazon Cognito by running a test file named CognitoKotlinTest. This file uses JUnit 5 to run the JUnit tests and is located in the src/test/kotlin folder. For more information, see https://junit.org/junit5/.
You can execute the JUnit tests from an IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed.
Test 3 passed
WARNING: Running these JUnit tests manipulates real Amazon resources and may incur charges on your account.
Before running the Amazon Cognito JUnit tests, you must define values in the config.properties file located in the resources folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail.
Define these values to successfully run the JUnit tests:
To execute the JUnit tests from the command line, you can use the following command.
mvn test
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0