Skip to content

Commit b44a622

Browse files
author
Yaroslav Buzko
committed
Massage S3 test bucket name to avoid underscores
1 parent 6081647 commit b44a622

File tree

1 file changed

+2
-1
lines changed
  • test/service-test-utils/src/main/java/software/amazon/awssdk/testutils/service

1 file changed

+2
-1
lines changed

test/service-test-utils/src/main/java/software/amazon/awssdk/testutils/service/S3BucketUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public static String temporaryBucketName(Class<?> clz) {
6464
* @return an s3 bucket name
6565
*/
6666
public static String temporaryBucketName(String prefix) {
67-
String bucketName = lowerCase(prefix) + "-" + lowerCase(USER_NAME.getStringValueOrThrow()) + "-" + RANDOM.nextInt(10000);
67+
String bucketName =
68+
lowerCase(prefix) + "-" + lowerCase(USER_NAME.getStringValueOrThrow()).replace("_", "-") + "-" + RANDOM.nextInt(10000);
6869
if (bucketName.length() > 63) {
6970
throw new RuntimeException("S3 buckets can only be 63 chars in length, try a shorter prefix");
7071
}

0 commit comments

Comments
 (0)