Update S3 and S3Control tests for auth scheme and endpoint resolution migration#6955
Open
S-Saranya1 wants to merge 2 commits into
Conversation
… pipeline migration
davidh44
approved these changes
May 11, 2026
davidh44
reviewed
May 11, 2026
| import software.amazon.awssdk.services.s3.model.Delete; | ||
| import software.amazon.awssdk.services.s3.model.DeleteObjectsRequest; | ||
| import software.amazon.awssdk.services.s3.model.ObjectIdentifier; | ||
| import software.amazon.awssdk.utils.AttributeMap; |
davidh44
reviewed
May 11, 2026
| } | ||
|
|
||
| @Test | ||
| void callingDeleteObjects_requestWithCompleteListOfKey_returnsRightValues() { |
Contributor
There was a problem hiding this comment.
should this test also be updated to use request POJO and S3EndpointParams instead of S3Client?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
After moving auth scheme resolution and endpoint resolution from interceptors to pipeline stages (#6755, #6820), some tests that read resolved values (like endpoint URLs, signing properties, or auth scheme params) during interceptor hooks now get null or stale values, because resolution hasn't happened yet at that point.
Modifications
Test files that are updated
1.
customization.config- There is an auto-generated test S3ClientEndpointTests.java (generated from endpoint-tests.json) that verifies the endpoint rules engine produces correct error messages for various inputs. One test case - "Access points when Access points explicitly disabled (used for CreateBucket)" expects the error: "Access points are not supported for this operation" from the endpoint rules engine.Before migration: Endpoint resolution ran in an interceptor (modifyRequest) which was registered before CreateBucketInterceptor, so the endpoint rules error was thrown first matching the test expectation.
After migration: CreateBucketInterceptor.modifyRequest() runs first (interceptor phase) and validates the bucket name. It sees an ARN and throws its own validation error before EndpointResolutionStage (pipeline phase) gets a chance to run and return the expected error.
This test can't be modified because it's auto-generated from the endpoint rules test suite. Skipping it via customization.config with a comment explaining why.
2.
S3ControlWireMockRerouteInterceptor.java- Capture resolved endpoint inbeforeTransmission(from RESOLVED_ENDPOINT attribute) instead ofmodifyHttpRequestwhere endpoint isn't resolved yet.3.
UrlEncodingTest.java- ReadSIGNER_DOUBLE_URL_ENCODEinbeforeTransmissioninstead ofbeforeExecution, since the value is only available after auth scheme4.
S3CrossRegionAsyncClientTest.java,S3CrossRegionSyncClientTest.java- These tests verify that after a cross-region redirect (301), the client retries with the correct region. The test mocks the S3EndpointProvider and captures the S3EndpointParams passed to it.After the migration, the mock endpoint provider gets called more times than before, once for the initial attempt (with the original region) and once for the retry (with the redirected region). Previously, the test asserted all captured calls had the redirected region. Now we assert only the last call, which is the final successful resolution.
Additionally, the cross-region client internally calls HeadBucket to discover the bucket's region. This call also triggers the capture interceptor, overwriting the captured endpoint provider with the default one (not the BucketEndpointProvider we want to assert). Fixed by skipping HeadBucket requests in the capture interceptor.
5.
ListOfStringsAuthParamPluginTest.java— This test verifies that deleteObjectKeys (list of object keys from a DeleteObjects request) are correctly extracted and passed to the endpoint resolution logic.Previously, the test used a plugin that wrapped the S3AuthSchemeProvider to capture the keys when auth scheme options were resolved. After the migration, auth scheme options resolution moved to the generated client code, which reads the provider directly from client configuration, bypassing the plugin-wrapped provider. So the plugin never captures the keys.
Fixed by calling S3EndpointResolverUtils.ruleParams() directly, the same method the generated code uses to extract endpoint params from the request. This tests the same extraction logic without depending on how the auth scheme provider is wired.
Testing
Make sure the modified tests pass
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License