Skip to content

Commit c205a07

Browse files
committed
Integration tests for multi-region access points including crud operations and calling access point
1 parent 9199a2e commit c205a07

File tree

3 files changed

+382
-0
lines changed

3 files changed

+382
-0
lines changed

services/s3control/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,11 @@
8888
<version>${awsjavasdk.version}</version>
8989
<scope>test</scope>
9090
</dependency>
91+
<dependency>
92+
<groupId>software.amazon.awssdk</groupId>
93+
<artifactId>auth-crt</artifactId>
94+
<version>${awsjavasdk.version}</version>
95+
<scope>test</scope>
96+
</dependency>
9197
</dependencies>
9298
</project>

services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTestBase.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import software.amazon.awssdk.services.s3.model.NoSuchBucketException;
4242
import software.amazon.awssdk.services.s3.model.S3Exception;
4343
import software.amazon.awssdk.services.s3.model.S3Object;
44+
import software.amazon.awssdk.services.sts.StsClient;
4445
import software.amazon.awssdk.testutils.Waiter;
4546
import software.amazon.awssdk.testutils.service.AwsTestBase;
4647

@@ -58,6 +59,10 @@ public class S3ControlIntegrationTestBase extends AwsTestBase {
5859

5960
protected static S3AsyncClient s3Async;
6061

62+
protected static StsClient sts;
63+
64+
protected static String accountId;
65+
6166
/**
6267
* Loads the AWS account info for the integration tests and creates an S3
6368
* client for tests to use.
@@ -66,6 +71,11 @@ public class S3ControlIntegrationTestBase extends AwsTestBase {
6671
public static void setUp() throws Exception {
6772
s3 = s3ClientBuilder().build();
6873
s3Async = s3AsyncClientBuilder().build();
74+
sts = StsClient.builder()
75+
.region(DEFAULT_REGION)
76+
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
77+
.build();
78+
accountId = sts.getCallerIdentity().account();
6979
}
7080

7181
protected static S3ClientBuilder s3ClientBuilder() {

0 commit comments

Comments
 (0)