Home
last modified time | relevance | path

Searched refs:mockHttpClient (Results 1 – 25 of 38) sorted by relevance

12

/external/aws-sdk-java-v2/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/
DMultiRegionAccessPointEndpointResolutionTest.java45 private MockHttpClient mockHttpClient; field in MultiRegionAccessPointEndpointResolutionTest
49 mockHttpClient = new MockSyncHttpClient(); in setup()
54 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in multiRegionArn_correctlyRewritesEndpoint()
57 assertEndpointMatches(mockHttpClient.getLastRequest(), MULTI_REGION_ENDPOINT.toString()); in multiRegionArn_correctlyRewritesEndpoint()
62 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in multiRegionArn_useArnRegionEnabled_correctlyRewritesEndpoint()
68 assertEndpointMatches(mockHttpClient.getLastRequest(), MULTI_REGION_ENDPOINT.toString()); in multiRegionArn_useArnRegionEnabled_correctlyRewritesEndpoint()
84 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in multiRegionArn_dualstackEnabled_throwsIllegalArgumentException()
97 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in multiRegionArn_fipsRegion_throwsIllegalArgumentException()
112 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in multiRegionArn_accelerateEnabled_throwsIllegalArgumentException()
125 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in multiRegionArn_pathStyle_throwsIllegalArgumentException()
[all …]
DOutpostAccessPointArnEndpointResolutionTest.java44 private MockSyncHttpClient mockHttpClient; field in OutpostAccessPointArnEndpointResolutionTest
49 mockHttpClient = new MockSyncHttpClient(); in setup()
56 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in outpostArn_correctlyRewritesEndpoint()
62 …assertThat(mockHttpClient.getLastRequest().firstMatchingHeader("Authorization").get()).contains("s… in outpostArn_correctlyRewritesEndpoint()
63 assertEndpointMatches(mockHttpClient.getLastRequest(), customEndpoint.toString()); in outpostArn_correctlyRewritesEndpoint()
68 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in outpostArn_dualstackEnabled_throwsIllegalArgumentException()
79 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in outpostArn_dualstackEnabledViaClient_throwsIllegalArgumentException()
90 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in outpostArn_fipsRegion_throwsIllegalArgumentException()
101 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in outpostArn_fipsEnabled_throwsIllegalArgumentException()
112 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in outpostArn_accelerateEnabled_throwsIllegalArgumentException()
[all …]
DS3ObjectLambdaEndpointResolutionTest.java39 private MockSyncHttpClient mockHttpClient; field in S3ObjectLambdaEndpointResolutionTest
43 mockHttpClient = new MockSyncHttpClient(); in setup()
44 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in setup()
196 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_normalCase_slashDelimiter_resolveEndpointCorrectly()
206 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_normalCase_colonDelimiter_resolveEndpointCorrectly()
216 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_fips_resolveEndpointCorrectly()
228 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_crossRegion_useArnRegionTrue_resolveEndpointCorrectly()
242 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_externalRegion_useArnRegionTrue_resolveEndpointCorrectly()
256 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_globalRegion_useArnRegionTrue_resolveEndpointCorrectly()
270 assertEndpointMatches(mockHttpClient.getLastRequest(), expectedEndpoint); in objectLambdaArn_cnPartitionSameRegion_useArnRegionTrue_resolveEndpointCorrectly()
[all …]
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/
DRetryHeaderTestSuite.java33 protected final T mockHttpClient; field in RetryHeaderTestSuite
35 protected RetryHeaderTestSuite(T mockHttpClient) { in RetryHeaderTestSuite() argument
36 this.mockHttpClient = mockHttpClient; in RetryHeaderTestSuite()
41 mockHttpClient.reset(); in setupClient()
48 mockHttpClient.stubResponses(retryableFailure(), retryableFailure(), success()); in invocationIdSharedBetweenRetries()
52 List<SdkHttpRequest> requests = mockHttpClient.getRequests(); in invocationIdSharedBetweenRetries()
62 mockHttpClient.stubResponses(success()); in invocationIdDifferentBetweenApiCalls()
67 List<SdkHttpRequest> requests = mockHttpClient.getRequests(); in invocationIdDifferentBetweenApiCalls()
76 mockHttpClient.stubResponses(retryableFailure(), success()); in retryAttemptAndMaxAreCorrect()
80 List<SdkHttpRequest> requests = mockHttpClient.getRequests(); in retryAttemptAndMaxAreCorrect()
DRetryFailureTestSuite.java36 protected final T mockHttpClient; field in RetryFailureTestSuite
38 protected RetryFailureTestSuite(T mockHttpClient) { in RetryFailureTestSuite() argument
39 this.mockHttpClient = mockHttpClient; in RetryFailureTestSuite()
44 mockHttpClient.reset(); in setupClient()
51 mockHttpClient.stubResponses(retryableFailure(), in clientSideErrorsIncludeSuppressedExceptions()
/external/aws-sdk-java-v2/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/
DXmlPayloadStringTest.java46 private MockSyncHttpClient mockHttpClient; field in XmlPayloadStringTest
50 mockHttpClient = new MockSyncHttpClient(); in setUp()
54 .httpClient(mockHttpClient) in setUp()
60 mockHttpClient.reset(); in reset()
65 mockHttpClient.stubNextResponse(mockResponse(PAYLOAD_BYTES_XML), Duration.ofMillis(500)); in operationWithExplicitPayloadString_xml_marshallsAndUnmarshallsCorrectly()
72 SdkHttpFullRequest loggedRequest = (SdkHttpFullRequest) mockHttpClient.getLastRequest(); in operationWithExplicitPayloadString_xml_marshallsAndUnmarshallsCorrectly()
82mockHttpClient.stubNextResponse(mockResponse(PAYLOAD_BYTES_NON_XML), Duration.ofMillis(500)); in operationWithExplicitPayloadString_nonXml_marshallsAndUnmarshallsCorrectly()
89 SdkHttpFullRequest loggedRequest = (SdkHttpFullRequest) mockHttpClient.getLastRequest(); in operationWithExplicitPayloadString_nonXml_marshallsAndUnmarshallsCorrectly()
99 mockHttpClient.stubNextResponse(mockResponse(PAYLOAD_BYTES_XML), Duration.ofMillis(500)); in operationWithExplicitPayloadBlob_xml_marshallsAndUnmarshallsCorrectly()
106 SdkHttpFullRequest loggedRequest = (SdkHttpFullRequest) mockHttpClient.getLastRequest(); in operationWithExplicitPayloadBlob_xml_marshallsAndUnmarshallsCorrectly()
[all …]
DTruncatedRequestStreamTest.java48 private SdkHttpClient mockHttpClient; field in TruncatedRequestStreamTest
52 mockHttpClient = mock(SdkHttpClient.class); in setup()
66 when(mockHttpClient.prepareRequest(any())).thenReturn(mockExecutableRequest); in setup()
71 .httpClient(mockHttpClient) in setup()
89 verify(mockHttpClient).prepareRequest(requestCaptor.capture()); in streamingRequest_specifiedLengthTruncatesStream_lengthHonored()
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/
DRequestCompressionTest.java52 private MockSyncHttpClient mockHttpClient; field in RequestCompressionTest
59 mockHttpClient = new MockSyncHttpClient(); in setUp()
63 .httpClient(mockHttpClient) in setUp()
75 mockHttpClient.reset(); in reset()
80 mockHttpClient.stubNextResponse(mockResponse(), Duration.ofMillis(500)); in syncNonStreamingOperation_compressionEnabledThresholdOverridden_compressesCorrectly()
90 SdkHttpFullRequest loggedRequest = (SdkHttpFullRequest) mockHttpClient.getLastRequest(); in syncNonStreamingOperation_compressionEnabledThresholdOverridden_compressesCorrectly()
102 mockHttpClient.stubNextResponse(mockResponse(), Duration.ofMillis(500)); in syncNonStreamingOperation_payloadSizeLessThanCompressionThreshold_doesNotCompress()
110 SdkHttpFullRequest loggedRequest = (SdkHttpFullRequest) mockHttpClient.getLastRequest(); in syncNonStreamingOperation_payloadSizeLessThanCompressionThreshold_doesNotCompress()
120 mockHttpClient.stubNextResponse(mockResponse(), Duration.ofMillis(500)); in syncStreamingOperation_compressionEnabled_compressesCorrectly()
126 SdkHttpFullRequest loggedRequest = (SdkHttpFullRequest) mockHttpClient.getLastRequest(); in syncStreamingOperation_compressionEnabled_compressesCorrectly()
[all …]
DTraceIdTest.java42 try (MockSyncHttpClient mockHttpClient = new MockSyncHttpClient(); in traceIdInterceptorIsEnabled()
46 .httpClient(mockHttpClient) in traceIdInterceptorIsEnabled()
48 mockHttpClient.stubNextResponse(HttpExecuteResponse.builder() in traceIdInterceptorIsEnabled()
55 …assertThat(mockHttpClient.getLastRequest().firstMatchingHeader("X-Amzn-Trace-Id")).hasValue("bar"); in traceIdInterceptorIsEnabled()
DHostPrefixTest.java40 private MockSyncHttpClient mockHttpClient; field in HostPrefixTest
48 mockHttpClient = new MockSyncHttpClient(); in setupClient()
55 .httpClient(mockHttpClient) in setupClient()
88 mockHttpClient.stubNextResponse(HttpExecuteResponse.builder() in syncValidHostPrefix_shouldPrefixEndpoint()
94 … assertThat(mockHttpClient.getLastRequest().getUri().getHost()).isEqualTo("123-foo.localhost"); in syncValidHostPrefix_shouldPrefixEndpoint()
/external/aws-sdk-java-v2/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/connection/
DSyncClientConnectionTest.java47 private MockSyncHttpClient mockHttpClient; field in SyncClientConnectionTest
51 mockHttpClient = new MockSyncHttpClient(); in setupClient()
56 .httpClient(mockHttpClient) in setupClient()
63 mockHttpClient.stubNextResponse(mockResponse(inputStream, 400)); in nonStreaming_exception_shouldCloseConnection()
73 mockHttpClient.stubNextResponse(mockResponse(inputStream, 200)); in nonStreaming_successfulResponse_shouldCloseConnection()
81 mockHttpClient.stubNextResponse(mockResponse(inputStream, 200)); in streamingOut_successfulResponse_shouldCloseConnection()
90 mockHttpClient.stubNextResponse(mockResponse(inputStream, 400)); in streamingOut_errorResponse_shouldCloseConnection()
100 mockHttpClient.stubNextResponse(mockResponse(inputStream, 200)); in streamingOut_connectionLeftOpen_shouldNotCloseStream()
120 mockHttpClient.stubNextResponse(mockResponse(inputStream, 200)); in streamingOut_toInputStream_closeResponseStreamShouldCloseUnderlyingStream()
134 mockHttpClient.stubNextResponse(mockResponse(responseStream, 200)); in streamingIn_providedRequestBody_shouldNotCloseRequestStream()
[all …]
/external/aws-sdk-java-v2/test/module-path-tests/src/main/java/software/amazon/awssdk/modulepath/tests/mocktests/
DBaseMockApiCall.java34 protected final MockHttpClient mockHttpClient; field in BaseMockApiCall
40 this.mockHttpClient = new MockHttpClient(); in BaseMockApiCall()
46 mockHttpClient.stubNextResponse(successResponse(protocol)); in successfulApiCall()
48 mockHttpClient.reset(); in successfulApiCall()
53 mockHttpClient.stubNextResponse(errorResponse(protocol)); in failedApiCall()
61 mockHttpClient.reset(); in failedApiCall()
/external/aws-sdk-java-v2/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/endpoint/
DEndpointTraitTest.java52 private SdkHttpClient mockHttpClient; field in EndpointTraitTest
70 when(mockHttpClient.prepareRequest(any())).thenReturn(abortableCallable); in setup()
82 verify(mockHttpClient).prepareRequest(httpRequestCaptor.capture()); in hostExpression_withoutInputMemberLabel()
102 verify(mockHttpClient).prepareRequest(httpRequestCaptor.capture()); in hostExpression_withInputMemberLabel()
129 verify(mockHttpClient).prepareRequest(httpRequestCaptor.capture()); in clientWithDisabledHostPrefix_withoutInputMemberLabel_usesOriginalUri()
145 verify(mockHttpClient).prepareRequest(httpRequestCaptor.capture()); in clientWithDisabledHostPrefix_withInputMemberLabel_usesOriginalUri()
162 .httpClient(mockHttpClient) in clientBuilder()
/external/aws-sdk-java-v2/services/s3/src/test/java/software/amazon/awssdk/services/s3/bucketaddressingsep/
DVirtualHostAddressingSepTest.java43 private MockSyncHttpClient mockHttpClient; field in VirtualHostAddressingSepTest
52 mockHttpClient = new MockSyncHttpClient(); in setup()
71 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in assertTestCase()
74 assertThat(mockHttpClient.getLastRequest().getUri()) in assertTestCase()
81 .httpClient(mockHttpClient) in constructClient()
/external/aws-sdk-java-v2/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/
DMultiRegionAccessPointSigningFunctionalTest.java52 private MockHttpClient mockHttpClient; field in MultiRegionAccessPointSigningFunctionalTest
56 mockHttpClient = new MockSyncHttpClient(); in setup()
57 mockHttpClient.stubNextResponse(mockListObjectsResponse()); in setup()
99 Map<String, List<String>> headers = mockHttpClient.getLastRequest().headers(); in verifyRequest()
112 .httpClient((MockSyncHttpClient) mockHttpClient) in clientBuilder()
/external/aws-sdk-java-v2/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/
DMetricReportingTest.java54 public ConnectionManagerAwareHttpClient mockHttpClient; field in MetricReportingTest
61 when(mockHttpClient.execute(any(HttpUriRequest.class), any(HttpContext.class))) in methodSetup()
63 when(mockHttpClient.getHttpClientConnectionManager()).thenReturn(cm); in methodSetup()
89 …when(mockHttpClient.getHttpClientConnectionManager()).thenReturn(mock(HttpClientConnectionManager.… in prepareRequest_connectionManagerNotPooling_callableCalled_metricsReported()
112 return new ApacheHttpClient(mockHttpClient, config, AttributeMap.empty()); in newClient()
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolquery/
DAsyncOperationCancelTest.java46 private SdkAsyncHttpClient mockHttpClient; field in AsyncOperationCancelTest
58 .httpClient(mockHttpClient) in setUp()
62 when(mockHttpClient.execute(any())).thenReturn(executeFuture); in setUp()
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/metrics/
DCoreMetricsTest.java78 private SdkHttpClient mockHttpClient; field in CoreMetricsTest
89 .httpClient(mockHttpClient) in setup()
115 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in setup()
137 .httpClient(mockHttpClient) in testApiCall_noConfiguredPublisher_succeeds()
230 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in testApiCall_serviceReturnsError_errorInfoIncludedInMetrics()
271 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in testApiCall_httpClientThrowsNetworkError_errorTypeIncludedInMetrics()
329 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in testApiCall_apiAttempt_ttfbSeparateFromResponseBody()
382 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in testApiCall_apiAttempt_ttlbIncludesReadingFullResponse()
436 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in testApiCall_apiAttempt_throughputCalculatedCorrectly()
DSyncClientMetricPublisherResolutionTest.java49 private SdkHttpClient mockHttpClient; field in SyncClientMetricPublisherResolutionTest
128 .httpClient(mockHttpClient) in clientWithPublishers()
150 when(mockHttpClient.prepareRequest(any(HttpExecuteRequest.class))) in clientWithPublishers()
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestxml/
DAsyncOperationCancelTest.java50 private SdkAsyncHttpClient mockHttpClient; field in AsyncOperationCancelTest
62 .httpClient(mockHttpClient) in setUp()
66 when(mockHttpClient.execute(any())).thenReturn(executeFuture); in setUp()
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/
DAsyncOperationCancelTest.java51 private SdkAsyncHttpClient mockHttpClient; field in AsyncOperationCancelTest
63 .httpClient(mockHttpClient) in setUp()
67 when(mockHttpClient.execute(any())).thenReturn(executeFuture); in setUp()
/external/aws-sdk-java-v2/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/
DBaseApiCallAttemptTimeoutTest.java68mockHttpClient().stubResponses(Pair.of(mockResponse(200), DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT), in firstAttemptTimeout_retryFinishWithInTime_shouldNotTimeout()
77mockHttpClient().stubResponses(Pair.of(mockResponse(200), DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT), in firstAttemptTimeout_retryFinishWithInTime500_shouldNotTimeout()
DBaseApiCallTimeoutTest.java72 mockHttpClient().stubResponses(Pair.of(mockResponse(500), DELAY_BEFORE_TIMEOUT), in nonstreamingOperation_retrySucceeded_FinishedWithinTime_shouldNotTimeout()
81 mockHttpClient().stubResponses(Pair.of(mockResponse(500), DELAY_BEFORE_TIMEOUT), in nonstreamingOperation_retryWouldSucceed_notFinishedWithinTime_shouldTimeout()
/external/aws-sdk-java-v2/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/eventstreams/
DEventMarshallingTest.java55 public SdkAsyncHttpClient mockHttpClient; field in EventMarshallingTest
66 when(mockHttpClient.execute(any(AsyncExecuteRequest.class))).thenAnswer(this::mockExecute); in setup()
70 .httpClient(mockHttpClient) in setup()
/external/aws-sdk-java-v2/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/
DEndpointOverrideEndpointResolutionTest.java54 private final MockSyncHttpClient mockHttpClient; field in EndpointOverrideEndpointResolutionTest
62 this.mockHttpClient = new MockSyncHttpClient(); in EndpointOverrideEndpointResolutionTest()
70 .httpClient(mockHttpClient) in EndpointOverrideEndpointResolutionTest()
80 mockHttpClient.stubNextResponse(response); in EndpointOverrideEndpointResolutionTest()
99 … assertThat(mockHttpClient.getLastRequest().getUri()).isEqualTo(testCase.expectedEndpoint); in s3ControlClient_endpointSigningRegionAndServiceNamesAreCorrect()

12