chungen0126 opened a new pull request, #11950: URL: https://github.com/apache/ozone/pull/11950
## What changes were proposed in this pull request? `TestInitiateMultipartUpload#testInitiateMultipartUploadRejectsFileAncestor` and `testInitiateMultipartUploadRejectsExistingDirectory` (both parameters) fail since HDDS-16681 with `Expected OS3Exception to be thrown, but nothing was thrown`. HDDS-16681 changed `ObjectEndpoint.initializeMultipartUpload` to look up the bucket through `ObjectRequestContext.getBucket()`, which calls `ClientProtocol.getBucketDetails(null, bucket)` instead of `getVolume().getBucket(bucket)`. The two tests (added by HDDS-17644 and HDDS-17658) still inject the `NOT_A_FILE` `OMException` by spying `rest.getVolume().getBucket(bucket)`, so the stub is never reached and the endpoint returns 200 instead of `InvalidRequest`. This PR updates the tests to spy `rest.getClientProtocol()` and stub `getBucketDetails(null, bucket)` to return the spied `OzoneBucket`, matching how HDDS-16681 rewrote the other S3 Gateway tests (e.g. `TestObjectPut`) and the sibling `testUploadPartRejectsFileAncestor` in the same class. The now-unused `OzoneVolume` import is removed. No production code is changed. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17713 ## How was this patch tested? - Reproduced locally on master before the change: `TestInitiateMultipartUpload` 7 run / 3 failures, same as the Jira. - After the change: `mvn -pl :ozone-s3gateway test -Dtest=TestInitiateMultipartUpload` 7 run / 0 failures. - `hadoop-ozone/dev-support/checks/checkstyle.sh` passes. Generated-by: Claude Code (claude-fable-5-1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
