@@ -307,6 +307,39 @@ public void testS3ClientCreateDestroyHttpProxyEnvironmentVariableSetting() {
307307 }
308308 }
309309
310+ @ Test
311+ public void testS3ClientCreateMD5MetaRequest () {
312+ skipIfAndroid ();
313+ skipIfNetworkUnavailable ();
314+
315+ S3ClientOptions clientOptions = new S3ClientOptions ().withRegion (REGION )
316+ .withComputeContentMd5 (true )
317+ .withMemoryLimitInBytes (5L * 1024 * 1024 * 1024 );
318+ try (S3Client client = createS3Client (clientOptions )) {
319+ S3MetaRequestResponseHandler responseHandler = new S3MetaRequestResponseHandler () {
320+ @ Override
321+ public int onResponseBody (ByteBuffer bodyBytesIn , long objectRangeStart , long objectRangeEnd ) {
322+ return 0 ;
323+ }
324+
325+ @ Override
326+ public void onFinished (S3FinishedResponseContext context ) {
327+ }
328+ };
329+
330+ HttpHeader [] headers = { new HttpHeader ("Host" , ENDPOINT ) };
331+ HttpRequest httpRequest = new HttpRequest ("GET" , PRE_EXIST_1MB_PATH , headers , null );
332+
333+ S3MetaRequestOptions metaRequestOptions = new S3MetaRequestOptions ()
334+ .withMetaRequestType (MetaRequestType .GET_OBJECT )
335+ .withChecksumAlgorithm (ChecksumAlgorithm .MD5 )
336+ .withHttpRequest (httpRequest )
337+ .withResponseHandler (responseHandler );
338+
339+ Assert .assertThrows (IllegalArgumentException .class , () -> { client .makeMetaRequest (metaRequestOptions ); });
340+ }
341+ }
342+
310343 @ Test
311344 public void testS3Get () {
312345 skipIfAndroid ();
@@ -1385,13 +1418,29 @@ public void onFinished(S3FinishedResponseContext context) {
13851418 }
13861419
13871420 @ Test
1388- public void testS3PutTrailerChecksums () throws Exception {
1421+ public void testS3PutTrailerChecksumsCRC64 () throws Exception {
13891422 skipIfAndroid ();
13901423 skipIfNetworkUnavailable ();
13911424 Assume .assumeTrue (hasAwsCredentials ());
13921425 testS3RoundTripWithChecksumHelper (ChecksumAlgorithm .CRC64NVME , ChecksumLocation .TRAILER , false , false );
13931426 }
13941427
1428+ @ Test
1429+ public void testS3PutTrailerChecksumsSHA512 () throws Exception {
1430+ skipIfAndroid ();
1431+ skipIfNetworkUnavailable ();
1432+ Assume .assumeTrue (hasAwsCredentials ());
1433+ testS3RoundTripWithChecksumHelper (ChecksumAlgorithm .SHA512 , ChecksumLocation .TRAILER , false , false );
1434+ }
1435+
1436+ @ Test
1437+ public void testS3PutTrailerChecksumsXXHASH3_64 () throws Exception {
1438+ skipIfAndroid ();
1439+ skipIfNetworkUnavailable ();
1440+ Assume .assumeTrue (hasAwsCredentials ());
1441+ testS3RoundTripWithChecksumHelper (ChecksumAlgorithm .XXHASH3 , ChecksumLocation .TRAILER , false , false );
1442+ }
1443+
13951444 @ Test
13961445 public void testS3PutHeaderChecksums () throws Exception {
13971446 skipIfAndroid ();
0 commit comments