Search in sources :

Example 1 with AwsCrtResponseBodyPublisher

use of software.amazon.awssdk.http.crt.internal.AwsCrtResponseBodyPublisher in project aws-sdk-java-v2 by aws.

the class AwsCrtResponseBodyPublisherReactiveStreamCompatTest method createPublisher.

@Override
public Publisher<ByteBuffer> createPublisher(long elements) {
    HttpClientConnection connection = mock(HttpClientConnection.class);
    HttpStream stream = mock(HttpStream.class);
    AwsCrtResponseBodyPublisher bodyPublisher = new AwsCrtResponseBodyPublisher(connection, stream, new CompletableFuture<>(), Integer.MAX_VALUE);
    for (long i = 0; i < elements; i++) {
        bodyPublisher.queueBuffer(UUID.randomUUID().toString().getBytes());
    }
    bodyPublisher.setQueueComplete();
    return bodyPublisher;
}
Also used : AwsCrtResponseBodyPublisher(software.amazon.awssdk.http.crt.internal.AwsCrtResponseBodyPublisher) HttpClientConnection(software.amazon.awssdk.crt.http.HttpClientConnection) HttpStream(software.amazon.awssdk.crt.http.HttpStream)

Aggregations

HttpClientConnection (software.amazon.awssdk.crt.http.HttpClientConnection)1 HttpStream (software.amazon.awssdk.crt.http.HttpStream)1 AwsCrtResponseBodyPublisher (software.amazon.awssdk.http.crt.internal.AwsCrtResponseBodyPublisher)1