3939import software .amazon .awssdk .regions .Region ;
4040import software .amazon .awssdk .services .s3 .S3AsyncClient ;
4141import software .amazon .awssdk .services .s3 .S3Configuration ;
42+ import software .amazon .awssdk .services .s3 .internal .multipart .utils .MultipartDownloadTestUtils ;
4243import software .amazon .awssdk .services .s3 .model .GetObjectRequest ;
4344import software .amazon .awssdk .services .s3 .model .GetObjectResponse ;
4445
@@ -49,7 +50,7 @@ class NonLinearMultipartDownloaderSubscriberWiremockTest {
4950 private final String testKey = "test-key" ;
5051
5152 private S3AsyncClient s3AsyncClient ;
52- private MultipartDownloadTestUtil util ;
53+ private MultipartDownloadTestUtils utils ;
5354 private FileSystem fileSystem ;
5455 private Path testFile ;
5556
@@ -64,7 +65,7 @@ public void init(WireMockRuntimeInfo wiremock) throws Exception {
6465 .pathStyleAccessEnabled (true )
6566 .build ())
6667 .build ();
67- util = new MultipartDownloadTestUtil (testBucket , testKey , "test-etag" );
68+ utils = new MultipartDownloadTestUtils (testBucket , testKey , "test-etag" );
6869 fileSystem = Jimfs .newFileSystem (Configuration .unix ());
6970 testFile = fileSystem .getPath ("/test-file.txt" );
7071 }
@@ -78,7 +79,7 @@ void tearDown() throws Exception {
7879 @ ValueSource (ints = {2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 })
7980 void happyPath_multipartDownload (int numParts ) throws Exception {
8081 int partSize = 1024 ;
81- byte [] expectedBody = util .stubAllParts (testBucket , testKey , numParts , partSize );
82+ byte [] expectedBody = utils .stubAllParts (testBucket , testKey , numParts , partSize );
8283
8384 AsyncResponseTransformer <GetObjectResponse , GetObjectResponse > transformer = AsyncResponseTransformer .toFile (testFile );
8485 AsyncResponseTransformer .SplitResult <GetObjectResponse , GetObjectResponse > split = transformer .split (
@@ -103,13 +104,13 @@ void happyPath_multipartDownload(int numParts) throws Exception {
103104 byte [] actualBody = Files .readAllBytes (testFile );
104105 assertThat (actualBody ).isEqualTo (expectedBody );
105106 assertThat (getObjectResponse ).isNotNull ();
106- util .verifyCorrectAmountOfRequestsMade (numParts );
107+ utils .verifyCorrectAmountOfRequestsMade (numParts );
107108 }
108109
109110 @ Test
110111 void singlePartObject_shouldCompleteWithoutMultipart () throws Exception {
111112 int partSize = 1024 ;
112- byte [] expectedBody = util .stubSinglePart (testBucket , testKey , partSize );
113+ byte [] expectedBody = utils .stubSinglePart (testBucket , testKey , partSize );
113114
114115 AsyncResponseTransformer <GetObjectResponse , GetObjectResponse > transformer = AsyncResponseTransformer .toFile (testFile );
115116 AsyncResponseTransformer .SplitResult <GetObjectResponse , GetObjectResponse > split = transformer .split (
@@ -134,7 +135,7 @@ void singlePartObject_shouldCompleteWithoutMultipart() throws Exception {
134135 byte [] actualBody = Files .readAllBytes (testFile );
135136 assertThat (actualBody ).isEqualTo (expectedBody );
136137 assertThat (getObjectResponse ).isNotNull ();
137- util .verifyCorrectAmountOfRequestsMade (1 );
138+ utils .verifyCorrectAmountOfRequestsMade (1 );
138139 }
139140
140141}
0 commit comments