Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow STS testing with any account IDs. #1005

Merged
merged 1 commit into from
Jan 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,23 @@ public class AssumeRoleIntegrationTest extends IntegrationTestBaseWithIAM {
private static final int SESSION_DURATION = 60 * 60;

private static final String USER_NAME = "user-" + System.currentTimeMillis();
private static final String USER_ARN = "arn:aws:iam::131990247566:user/" + USER_NAME;
private static final String USER_ARN_FORMAT = "arn:aws:iam::%s:user/%s";
private static String USER_ARN;

private static final String ROLE_NAME = "java-test-role-" + System.currentTimeMillis();
private static final String ROLE_ARN = "arn:aws:iam::131990247566:role/" + ROLE_NAME;
private static final String ROLE_ARN_FORMAT = "arn:aws:iam::%s:role/%s";
private static String ROLE_ARN;

private static final String ASSUME_ROLE = "sts:AssumeRole";

private static AwsCredentials userCredentials;

@BeforeClass
public static void setup() throws InterruptedException {
String accountId = sts.getCallerIdentity().account();
USER_ARN = String.format(USER_ARN_FORMAT, accountId, USER_NAME);
ROLE_ARN = String.format(ROLE_ARN_FORMAT, accountId, ROLE_NAME);

// Create a user
iam.createUser(CreateUserRequest.builder().userName(USER_NAME).build());

Expand Down