use of software.amazon.awssdk.core.signer.NoOpSigner in project aws-sdk-java-v2 by aws.
the class AsyncHttpClientApiCallTimeoutTests method errorResponse_SlowAfterErrorRequestHandler_ThrowsApiCallTimeoutException.
@Test
public void errorResponse_SlowAfterErrorRequestHandler_ThrowsApiCallTimeoutException() {
stubFor(get(anyUrl()).willReturn(aResponse().withStatus(500).withBody("{}")));
ExecutionInterceptorChain interceptors = new ExecutionInterceptorChain(Collections.singletonList(new SlowExecutionInterceptor().onExecutionFailureWaitInSeconds(SLOW_REQUEST_HANDLER_TIMEOUT)));
SdkHttpFullRequest request = generateRequest();
InterceptorContext incerceptorContext = InterceptorContext.builder().request(NoopTestRequest.builder().build()).httpRequest(request).build();
ExecutionContext executionContext = ExecutionContext.builder().signer(new NoOpSigner()).interceptorChain(interceptors).executionAttributes(new ExecutionAttributes()).interceptorContext(incerceptorContext).metricCollector(MetricCollector.create("ApiCall")).build();
CompletableFuture future = httpClient.requestExecutionBuilder().originalRequest(NoopTestRequest.builder().build()).request(request).executionContext(executionContext).execute(combinedAsyncResponseHandler(noOpResponseHandler(), noOpResponseHandler(SdkServiceException.builder().build())));
assertThatThrownBy(future::join).hasCauseInstanceOf(ApiCallTimeoutException.class);
}
use of software.amazon.awssdk.core.signer.NoOpSigner in project aws-sdk-java-v2 by aws.
the class S3PresignerTest method getObject_NonSigV4SignersRaisesException.
@Test
public void getObject_NonSigV4SignersRaisesException() {
AwsRequestOverrideConfiguration override = AwsRequestOverrideConfiguration.builder().signer(new NoOpSigner()).build();
assertThatThrownBy(() -> presigner.presignGetObject(r -> r.signatureDuration(Duration.ofMinutes(5)).getObjectRequest(go -> go.bucket("foo34343434").key("bar").overrideConfiguration(override)))).isInstanceOf(IllegalStateException.class).hasMessageContaining("NoOpSigner");
}
use of software.amazon.awssdk.core.signer.NoOpSigner in project aws-sdk-java-v2 by aws.
the class S3PresignerTest method putObject_NonSigV4SignersRaisesException.
@Test
public void putObject_NonSigV4SignersRaisesException() {
AwsRequestOverrideConfiguration override = AwsRequestOverrideConfiguration.builder().signer(new NoOpSigner()).build();
assertThatThrownBy(() -> presigner.presignPutObject(r -> r.signatureDuration(Duration.ofMinutes(5)).putObjectRequest(go -> go.bucket("foo34343434").key("bar").overrideConfiguration(override)))).isInstanceOf(IllegalStateException.class).hasMessageContaining("NoOpSigner");
}
Aggregations