Search in sources :

Example 1 with AwsCredentialsProviderChain

use of software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain in project cas by apereo.

the class ChainingAWSCredentialsProviderTests method verifyInstance.

@Test
public void verifyInstance() throws Exception {
    val path = File.createTempFile("props", ".txt").getCanonicalPath();
    val p = (AwsCredentialsProviderChain) ChainingAWSCredentialsProvider.getInstance("accesskey", "secretKey", "profilePath", path);
    val credentials = p.resolveCredentials();
    assertNotNull(credentials);
    assertTrue(credentials instanceof AwsBasicCredentials);
    assertNotNull(ChainingAWSCredentialsProvider.getInstance());
}
Also used : lombok.val(lombok.val) AwsCredentialsProviderChain(software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain) AwsBasicCredentials(software.amazon.awssdk.auth.credentials.AwsBasicCredentials) Test(org.junit.jupiter.api.Test)

Aggregations

lombok.val (lombok.val)1 Test (org.junit.jupiter.api.Test)1 AwsBasicCredentials (software.amazon.awssdk.auth.credentials.AwsBasicCredentials)1 AwsCredentialsProviderChain (software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain)1