use of software.amazon.awssdk.auth.signer.AsyncAws4Signer in project aws-sdk-java-v2 by aws.
the class SignedAsyncRequestBodyUploadIntegrationTest method setup.
@BeforeClass
public static void setup() throws Exception {
S3IntegrationTestBase.setUp();
// Use a mock so we can introspect easily to verify that the signer was used for the request
mockSigner = mock(TestSigner.class);
AsyncAws4Signer realSigner = AsyncAws4Signer.create();
when(mockSigner.sign(any(SdkHttpFullRequest.class), any(AsyncRequestBody.class), any(ExecutionAttributes.class))).thenAnswer(i -> {
SdkHttpFullRequest request = i.getArgument(0, SdkHttpFullRequest.class);
AsyncRequestBody body = i.getArgument(1, AsyncRequestBody.class);
ExecutionAttributes executionAttributes = i.getArgument(2, ExecutionAttributes.class);
return realSigner.sign(request, body, executionAttributes);
});
testClient = s3AsyncClientBuilder().overrideConfiguration(o -> o.putAdvancedOption(SIGNER, mockSigner).addExecutionInterceptor(capturingInterceptor)).build();
createBucket(BUCKET);
}
Aggregations