rich7420 commented on code in PR #11950:
URL: https://github.com/apache/ozone/pull/11950#discussion_r4483802412
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestInitiateMultipartUpload.java:
##########
@@ -101,10 +100,10 @@ public void
testInitiateMultipartUploadRejectsFileAncestor() throws Exception {
OzoneClient client = new OzoneClientStub();
client.getObjectStore().createS3Bucket(bucket);
ObjectEndpoint rest = spy(getObjectEndpoint(client,
mock(HttpHeaders.class)));
- OzoneVolume volume = spy(rest.getVolume());
- OzoneBucket ozoneBucket = spy(volume.getBucket(bucket));
- doReturn(volume).when(rest).getVolume();
- doReturn(ozoneBucket).when(volume).getBucket(bucket);
+ ClientProtocol protocol = spy(rest.getClientProtocol());
+ OzoneBucket ozoneBucket = spy(protocol.getBucketDetails(null, bucket));
+ doReturn(protocol).when(rest).getClientProtocol();
+ doReturn(ozoneBucket).when(protocol).getBucketDetails(null, bucket);
Review Comment:
Could we save the injected exception and check that `exception.getCause()`
is the same instance in both tests? I tried throwing a different `NOT_A_FILE`
from `getBucketDetails` and the tests still passed without reaching
`initiateMultipartUpload`.
--
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]