public class ClientExecutionAndRequestTimerTestUtils extends Object
| Constructor and Description | 
|---|
| ClientExecutionAndRequestTimerTestUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | assertCanceledTasksRemoved(ScheduledThreadPoolExecutor timerExecutor)If the request completes successfully then the timer task should be canceled and should be
 removed from the thread pool to prevent build up of canceled tasks | 
| static void | assertClientExecutionTimerExecutorNotCreated(ClientExecutionTimer clientExecutionTimer)Assert that the executor backing  ClientExecutionTimerwas never created or used | 
| static void | assertCoreThreadsShutDownAfterBeingIdle(ScheduledThreadPoolExecutor timerExecutor)Waits until a little after the thread pools keep alive time and then asserts that all thre | 
| static void | assertNumberOfRetries(org.apache.http.client.HttpClient spyClient,
                     int expectedNumberOfRequests) | 
| static void | assertNumberOfTasksTriggered(ClientExecutionTimer clientExecutionTimer,
                            int expectedNumberOfTasks) | 
| static void | assertNumberOfTasksTriggered(HttpRequestTimer requestTimer,
                            int expectedNumberOfTasks) | 
| static void | assertRequestTimerExecutorNotCreated(HttpRequestTimer requestTimer)Assert that the executor backing  ClientExecutionTimerwas never created or used | 
| static void | assertResponseIsBuffered(HttpResponseProxy responseProxy)Assert response was buffered into memory to enforce the timeout on both connection
 established and reading of content | 
| static void | assertResponseWasNotBuffered(HttpResponseProxy responseProxy)Assert response was NOT buffered into memory as should be the case when client execution and
 request timeouts are disabled or an operation is streaming and it's content must be left open | 
| static void | assertTimerNeverTriggered(ScheduledThreadPoolExecutor timerExecutor)Asserts the timer never went off (I.E. | 
| static HttpResponseProxy | createHttpHeadResponseProxy()Creates Apache  HttpResponseProxywith a null entity | 
| static HttpResponseProxy | createHttpResponseProxySpy()Creates Apache  HttpResponseProxyspy | 
| static Request<?> | createMockGetRequest() | 
| static Request<?> | createMockHeadRequest() | 
| static ConnectionManagerAwareHttpClient | createRawHttpClientSpy(ClientConfiguration config)Creates Apache  HttpClientspy | 
| static void | execute(AmazonHttpClient httpClient,
       Request<?> request)Execute the request with a dummy response handler and error response handler | 
| static void | interruptCurrentThreadAfterDelay(long delay) | 
public ClientExecutionAndRequestTimerTestUtils()
public static void assertRequestTimerExecutorNotCreated(HttpRequestTimer requestTimer)
ClientExecutionTimer was never created or usedrequestTimer - public static void assertClientExecutionTimerExecutorNotCreated(ClientExecutionTimer clientExecutionTimer)
ClientExecutionTimer was never created or usedclientExecutionTimer - public static void assertResponseIsBuffered(HttpResponseProxy responseProxy)
responseProxy - Must by a spied HttpResponseProxypublic static void assertResponseWasNotBuffered(HttpResponseProxy responseProxy)
responseProxy - Must by a spied HttpResponseProxypublic static void assertCoreThreadsShutDownAfterBeingIdle(ScheduledThreadPoolExecutor timerExecutor)
timerExecutor - Executor used by timer implementationInterruptedExceptionpublic static void assertCanceledTasksRemoved(ScheduledThreadPoolExecutor timerExecutor)
timerExecutor - Executor used by timer implementationpublic static void assertTimerNeverTriggered(ScheduledThreadPoolExecutor timerExecutor)
timerExecutor - Executor used by timer implementationpublic static void assertNumberOfTasksTriggered(ClientExecutionTimer clientExecutionTimer, int expectedNumberOfTasks)
public static void assertNumberOfTasksTriggered(HttpRequestTimer requestTimer, int expectedNumberOfTasks)
public static ConnectionManagerAwareHttpClient createRawHttpClientSpy(ClientConfiguration config)
HttpClient spyconfig - ClientConfiguration for HttpClientFactoryHttpClient with ability to verify method calls or
         partially mockpublic static HttpResponseProxy createHttpResponseProxySpy() throws IOException
HttpResponseProxy spyHttpResponseProxy with ability to verify method calls
         or partially mockIOExceptionpublic static HttpResponseProxy createHttpHeadResponseProxy() throws IOException
HttpResponseProxy with a null entityIOExceptionpublic static Request<?> createMockGetRequest()
public static Request<?> createMockHeadRequest()
public static void execute(AmazonHttpClient httpClient, Request<?> request)
public static void assertNumberOfRetries(org.apache.http.client.HttpClient spyClient,
                                         int expectedNumberOfRequests)
public static void interruptCurrentThreadAfterDelay(long delay)
Copyright © 2023. All rights reserved.