anmolanmol1234 commented on code in PR #5488:
URL: https://github.com/apache/hadoop/pull/5488#discussion_r1145933338
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsRenameRetryRecovery.java:
##########
@@ -119,8 +156,383 @@ public void testRenameFailuresDueToIncompleteMetadata()
throws Exception {
// Verify renamePath occurred two times implying a retry was attempted.
verify(mockClient, times(2))
- .renamePath(sourcePath, destNoParentPath, null, null, null, false);
+ .renamePath(sourcePath, destNoParentPath, null, null, null, false,
isNamespaceEnabled);
+
+ }
+
+ AbfsClient getMockAbfsClient() throws IOException {
+ AzureBlobFileSystem fs = getFileSystem();
+
+ // adding mock objects to current AbfsClient
+ AbfsClient spyClient = Mockito.spy(fs.getAbfsStore().getClient());
+
+ Mockito.doAnswer(answer -> {
+ AbfsRestOperation op = new
AbfsRestOperation(AbfsRestOperationType.RenamePath,
+ spyClient, HTTP_METHOD_PUT, answer.getArgument(0),
answer.getArgument(1));
+ AbfsRestOperation spiedOp = Mockito.spy(op);
+ addSpyBehavior(spiedOp, op, spyClient);
+ return spiedOp;
+ }).when(spyClient).createRenameRestOperation(nullable(URL.class),
nullable(List.class));
Review Comment:
We can use anyList() here to suppress the unchecked warnings.
--
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]