Skip to content

Commit

Permalink
Update S3ExpressIntegrationTest to use dynamically created bucket nam…
Browse files Browse the repository at this point in the history
…es (#5231)
  • Loading branch information
joviegas committed May 17, 2024
1 parent 54c2b1b commit f7add20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.assertj.core.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static software.amazon.awssdk.testutils.service.AwsTestBase.CREDENTIALS_PROVIDER_CHAIN;
import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -101,6 +102,12 @@ public class S3ExpressIntegrationTest extends S3ExpressIntegrationTestBase {
private static S3AsyncClient s3CrtAsync;
private static String testBucket;

private static final String S3EXPRESS_BUCKET_PATTERN = temporaryBucketName(S3ExpressIntegrationTest.class) +"--%s--x-s3";

private static String getS3ExpressBucketNameForAz(String az) {
return String.format(S3EXPRESS_BUCKET_PATTERN, az);
}

@BeforeAll
static void setup() {
s3 = s3ClientBuilder(TEST_REGION).overrideConfiguration(o -> o.addExecutionInterceptor(capturingInterceptor))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@

public class S3ExpressIntegrationTestBase {

private static final String S3EXPRESS_BUCKET_PATTERN = "s3express-java-integ--%s--x-s3";
protected static final String STANDARD_BUCKET = "s3express-java-integ-tests";

protected static String getS3ExpressBucketNameForAz(String az) {
return String.format(S3EXPRESS_BUCKET_PATTERN, az);
}

protected static S3ClientBuilder s3ClientBuilder(Region region) {
return S3Client.builder()
.region(region)
Expand Down

0 comments on commit f7add20

Please sign in to comment.