chungen0126 commented on code in PR #11950:
URL: https://github.com/apache/ozone/pull/11950#discussion_r4483841513


##########
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:
   Good idea, thanks @rich7420. Added `assertSame(failure, 
exception.getCause())` in both tests in 5147c3fd64, so a `NOT_A_FILE` thrown 
anywhere other than `initiateMultipartUpload` now fails the test.



-- 
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]

Reply via email to