AmazonHttpClient { @Deprecated public <T> Response<T> execute(Request<?> request, HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler, HttpResponseHandler<AmazonServiceException> errorResponseHandler, ExecutionContext executionContext) { return execute(request, responseHandler, errorResponseHandler, executionContext, new AmazonWebServiceRequestAdapter(request.getOriginalRequest())); } AmazonHttpClient(ClientConfiguration config);  AmazonHttpClient(ClientConfiguration config,
                            RequestMetricCollector requestMetricCollector);  AmazonHttpClient(ClientConfiguration config,
                            RequestMetricCollector requestMetricCollector,
                            boolean useBrowserCompatibleHostNameVerifier);  AmazonHttpClient(ClientConfiguration config,
                            RequestMetricCollector requestMetricCollector,
                            boolean useBrowserCompatibleHostNameVerifier,
                            boolean calculateCRC32FromCompressedData); private  AmazonHttpClient(ClientConfiguration config,
                             RetryPolicy retryPolicy,
                             RequestMetricCollector requestMetricCollector,
                             boolean useBrowserCompatibleHostNameVerifier,
                             boolean calculateCRC32FromCompressedData); @SdkTestInternalApi  AmazonHttpClient(ClientConfiguration clientConfig,
                            ConnectionManagerAwareHttpClient httpClient,
                            RequestMetricCollector requestMetricCollector); private  AmazonHttpClient(ClientConfiguration clientConfig,
                             RetryPolicy retryPolicy,
                             RequestMetricCollector requestMetricCollector,
                             HttpClientSettings httpClientSettings); static Builder builder(); void shutdown(); @SdkTestInternalApi HttpRequestTimer getHttpRequestTimer(); @SdkTestInternalApi ClientExecutionTimer getClientExecutionTimer(); ResponseMetadata getResponseMetadataForRequest(AmazonWebServiceRequest request); RequestMetricCollector getRequestMetricCollector(); int getTimeOffset(); @Deprecated Response<T> execute(Request<?> request,
                                   HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
                                   HttpResponseHandler<AmazonServiceException> errorResponseHandler,
                                   ExecutionContext executionContext); @SdkInternalApi Response<T> execute(Request<?> request,
                                   HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
                                   HttpResponseHandler<AmazonServiceException> errorResponseHandler,
                                   ExecutionContext executionContext,
                                   RequestConfig requestConfig); RequestExecutionBuilder requestExecutionBuilder(); static final String HEADER_USER_AGENT; static final String HEADER_SDK_TRANSACTION_ID; static final String HEADER_SDK_RETRY_INFO; @SdkInternalApi
    static final Log requestLog; }
@Test public void testCredentialsSetInRequestContext() throws Exception { EasyMock.reset(httpClient); EasyMock .expect(httpClient.execute(EasyMock.<HttpRequestBase>anyObject(), EasyMock.<HttpContext>anyObject())) .andReturn(createBasicHttpResponse()) .once(); EasyMock.replay(httpClient); AmazonHttpClient client = new AmazonHttpClient(new ClientConfiguration(), httpClient, null); final BasicAWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AWSCredentialsProvider credentialsProvider = EasyMock.createMock(AWSCredentialsProvider.class); EasyMock.expect(credentialsProvider.getCredentials()) .andReturn(credentials) .anyTimes(); EasyMock.replay(credentialsProvider); ExecutionContext executionContext = new ExecutionContext(); executionContext.setCredentialsProvider(credentialsProvider); Request<?> request = mockRequest(SERVER_NAME, HttpMethodName.PUT, URI_NAME, true); HttpResponseHandler<AmazonWebServiceResponse<Object>> handler = createStubResponseHandler(); EasyMock.replay(handler); client.execute(request, handler, null, executionContext); assertEquals(credentials, request.getHandlerContext(HandlerContextKey.AWS_CREDENTIALS)); }