File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/test/java/software/amazon/encryption/s3 Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -393,9 +393,11 @@ public void customSetBufferSizeWithLargeObjectAsyncClient() throws IOException {
393393
394394 // Tight bound on the custom buffer size limit of 32MiB
395395 final long fileSizeExceedingDefaultLimit = 1024 * 1024 * 32 + 1 ;
396- final InputStream largeObjectStream = new BufferedInputStream (
397- new BoundedInputStream (fileSizeExceedingDefaultLimit )
398- );
396+ byte [] data = new byte [(int ) fileSizeExceedingDefaultLimit ];
397+ for (int j =0 ; j < data .length ; j ++) {
398+ data [i ] = (byte ) (j % 256 );
399+ }
400+ final InputStream largeObjectStream = new ByteArrayInputStream (data );
399401 ExecutorService singleThreadExecutor = Executors .newSingleThreadExecutor ();
400402 CompletableFuture <PutObjectResponse > futurePut = v3ClientWithBuffer32MiB .putObject (PutObjectRequest .builder ()
401403 .bucket (BUCKET )
@@ -422,7 +424,9 @@ public void customSetBufferSizeWithLargeObjectAsyncClient() throws IOException {
422424 .key (objectKey ), AsyncResponseTransformer .toBlockingInputStream ());
423425 ResponseInputStream <GetObjectResponse > output = futureGet .join ();
424426
425- assertTrue (IOUtils .contentEquals (new BoundedInputStream (fileSizeExceedingDefaultLimit ), output ));
427+ ByteArrayInputStream expectedStream = new ByteArrayInputStream (data );
428+ assertTrue (IOUtils .contentEquals (expectedStream , output ));
429+
426430 output .close ();
427431
428432 // Cleanup
You can’t perform that action at this time.
0 commit comments