use of software.amazon.awssdk.core.async.EmptyPublisher in project aws-xray-sdk-java by aws.
the class TracingInterceptorTest method mockSdkAsyncHttpClient.
private SdkAsyncHttpClient mockSdkAsyncHttpClient(SdkHttpResponse response) {
SdkAsyncHttpClient mockClient = Mockito.mock(SdkAsyncHttpClient.class);
when(mockClient.execute(Mockito.any(AsyncExecuteRequest.class))).thenAnswer((Answer<CompletableFuture<Void>>) invocationOnMock -> {
AsyncExecuteRequest request = invocationOnMock.getArgument(0);
SdkAsyncHttpResponseHandler handler = request.responseHandler();
handler.onHeaders(response);
handler.onStream(new EmptyPublisher<>());
return CompletableFuture.completedFuture(null);
});
return mockClient;
}
Aggregations