Skip to content

Various minor updates #2594

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

Merged
merged 1 commit into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<rxjava.version>2.2.21</rxjava.version>
<commons-codec.verion>1.10</commons-codec.verion>
<jmh.version>1.29</jmh.version>
<awscrt.version>0.13.2</awscrt.version>
<awscrt.version>0.13.5</awscrt.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version that contains multiple bucket support


<!--Test dependencies -->
<junit.version>4.13.1</junit.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package software.amazon.awssdk.transfer.s3;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
Expand All @@ -41,33 +40,30 @@ public class CrtExceptionTransformationIntegrationTest extends S3IntegrationTest

private static final int OBJ_SIZE = 8 * 1024;
private static RandomTempFile testFile;
private S3TransferManager transferManager;
private S3CrtAsyncClient s3Crt;
private static S3TransferManager transferManager;
private static S3CrtAsyncClient s3Crt;

@BeforeClass
public static void setupFixture() {
public static void setupFixture() throws IOException {
createBucket(BUCKET);
testFile = new RandomTempFile(BUCKET, OBJ_SIZE);
s3Crt = S3CrtAsyncClient.builder()
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.region(S3IntegrationTestBase.DEFAULT_REGION)
.build();
transferManager =
S3TransferManager.builder()
.s3ClientConfiguration(b -> b.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.region(S3IntegrationTestBase.DEFAULT_REGION))
.build();
}

@AfterClass
public static void tearDownFixture() {
deleteBucketAndAllContents(BUCKET);
}

@Before
public void methodSetup() throws IOException {
testFile = new RandomTempFile(BUCKET, OBJ_SIZE);
s3Crt = S3CrtAsyncClient.builder()
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.region(S3IntegrationTestBase.DEFAULT_REGION)
.build();
transferManager =
S3TransferManager.builder()
.s3ClientConfiguration(b -> b.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.region(S3IntegrationTestBase.DEFAULT_REGION)
.targetThroughputInGbps(20.0)
.minimumPartSizeInBytes(1000L))
.build();
s3Crt.close();
transferManager.close();
testFile.delete();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public CrtCredentialsProviderAdapter(AwsCredentialsProvider credentialsProvider)
byte[] accessKey = sdkCredentials.accessKeyId().getBytes(StandardCharsets.UTF_8);
byte[] secreteKey = sdkCredentials.secretAccessKey().getBytes(StandardCharsets.UTF_8);

// TODO: confirm with CRT if set empty means null. Currently setting null causes the crash
byte[] sessionTokens = new byte[0];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

byte[] sessionTokens = null;
if (sdkCredentials instanceof AwsSessionCredentials) {
sessionTokens =
((AwsSessionCredentials) sdkCredentials).sessionToken().getBytes(StandardCharsets.UTF_8);
Expand Down