chenboat commented on code in PR #9710: URL: https://github.com/apache/pinot/pull/9710#discussion_r1024598026
########## pinot-core/src/test/java/org/apache/pinot/core/data/manager/BaseTableDataManagerTest.java: ########## @@ -614,6 +622,61 @@ public void testDownloadAndDecrypt() } } + // case 2: if the attempt to download from deep storage exceeds, invoke downloadFromPeers. + @Test + public void testDownloadAndDecryptCase2() throws Exception { + File tempInput = new File(TEMP_DIR, "tmp.txt"); + FileUtils.write(tempInput, "this is from somewhere remote"); + + SegmentZKMetadata zkmd = mock(SegmentZKMetadata.class); + String backupCopyURI = "file://" + tempInput.getAbsolutePath(); + when(zkmd.getDownloadUrl()).thenReturn(backupCopyURI); + + TableDataManagerConfig config = createDefaultTableDataManagerConfig(); + when(config.getTablePeerDownloadScheme()).thenReturn("http"); + BaseTableDataManager tmgr = createSpyOfflineTableManager(config); + File tempRootDir = tmgr.getTmpSegmentDataDir("test-download-decrypt-peer"); + + // As the case 2 description says, we need to mock the static method fetchAndDecryptSegmentToLocal to + // throw the AttemptExceed exception; Due to the constrain that mockito static cannot do argument matching, Review Comment: s/constrain/constraint/g -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org