use of software.amazon.awssdk.services.sts.auth.StsAssumeRoleCredentialsProvider in project iep by Netflix.
the class AwsClientFactoryTest method createCredentialsProviderOverride.
@Test
public void createCredentialsProviderOverride() throws Exception {
AwsClientFactory factory = new AwsClientFactory(config);
AwsCredentialsProvider creds = factory.createCredentialsProvider("ec2-test");
Assert.assertTrue(creds instanceof StsAssumeRoleCredentialsProvider);
Assert.assertEquals("arn:aws:iam::1234567890:role/IepTest", getRequest(creds).roleArn());
Assert.assertEquals("iep", getRequest(creds).roleSessionName());
}
use of software.amazon.awssdk.services.sts.auth.StsAssumeRoleCredentialsProvider in project flink by apache.
the class AWSGeneralUtilTest method testGetCredentialsProviderAssumeRole.
@Test
public void testGetCredentialsProviderAssumeRole() {
Properties properties = spy(TestUtil.properties(AWS_CREDENTIALS_PROVIDER, "ASSUME_ROLE"));
properties.setProperty(AWS_REGION, "eu-west-2");
AwsCredentialsProvider credentialsProvider = AWSGeneralUtil.getCredentialsProvider(properties);
assertTrue(credentialsProvider instanceof StsAssumeRoleCredentialsProvider);
verify(properties).getProperty(AWSConfigConstants.roleArn(AWS_CREDENTIALS_PROVIDER));
verify(properties).getProperty(AWSConfigConstants.roleSessionName(AWS_CREDENTIALS_PROVIDER));
verify(properties).getProperty(AWSConfigConstants.externalId(AWS_CREDENTIALS_PROVIDER));
verify(properties).getProperty(AWS_REGION);
}
Aggregations