|
23 | 23 | import java.nio.ByteBuffer;
|
24 | 24 | import java.nio.file.Files;
|
25 | 25 | import java.nio.file.Path;
|
26 |
| -import java.util.concurrent.CompletableFuture; |
27 | 26 | import java.util.concurrent.ExecutorService;
|
28 | 27 | import java.util.concurrent.Executors;
|
29 | 28 | import org.junit.jupiter.api.AfterAll;
|
30 | 29 | import org.junit.jupiter.api.BeforeAll;
|
31 | 30 | import org.junit.jupiter.api.Test;
|
32 | 31 | import software.amazon.awssdk.core.async.AsyncResponseTransformer;
|
33 |
| -import software.amazon.awssdk.core.async.SdkPublisher; |
34 | 32 | import software.amazon.awssdk.crt.CrtResource;
|
35 |
| -import software.amazon.awssdk.http.async.SimpleSubscriber; |
36 | 33 | import software.amazon.awssdk.services.s3.S3AsyncClient;
|
37 | 34 | import software.amazon.awssdk.services.s3.S3IntegrationTestBase;
|
38 |
| -import software.amazon.awssdk.services.s3.internal.crt.S3CrtAsyncClient; |
39 | 35 | import software.amazon.awssdk.services.s3.model.GetObjectResponse;
|
40 | 36 | import software.amazon.awssdk.services.s3.model.PutObjectRequest;
|
41 | 37 | import software.amazon.awssdk.testutils.RandomTempFile;
|
@@ -97,35 +93,4 @@ void getObject_customResponseTransformer() {
|
97 | 93 |
|
98 | 94 | }
|
99 | 95 |
|
100 |
| - private static final class TestResponseTransformer implements AsyncResponseTransformer<GetObjectResponse, Void> { |
101 |
| - private CompletableFuture<Void> future; |
102 |
| - |
103 |
| - @Override |
104 |
| - public CompletableFuture<Void> prepare() { |
105 |
| - future = new CompletableFuture<>(); |
106 |
| - return future; |
107 |
| - } |
108 |
| - |
109 |
| - @Override |
110 |
| - public void onResponse(GetObjectResponse response) { |
111 |
| - assertThat(response).isNotNull(); |
112 |
| - } |
113 |
| - |
114 |
| - @Override |
115 |
| - public void onStream(SdkPublisher<ByteBuffer> publisher) { |
116 |
| - publisher.subscribe(new SimpleSubscriber(b -> { |
117 |
| - }) { |
118 |
| - @Override |
119 |
| - public void onComplete() { |
120 |
| - super.onComplete(); |
121 |
| - future.complete(null); |
122 |
| - } |
123 |
| - }); |
124 |
| - } |
125 |
| - |
126 |
| - @Override |
127 |
| - public void exceptionOccurred(Throwable error) { |
128 |
| - future.completeExceptionally(error); |
129 |
| - } |
130 |
| - } |
131 | 96 | }
|
0 commit comments