### Question:
CSVFileManager { public CSVFile downloadFile(CSVFile file) throws ServerCommunicationException, InvalidWriteEnablerException, ImmutableFileExistsException, RemoteFileDoesNotExistException, FailedToVerifySignatureException { return (CSVFile) downloadObject(file); } CSVFileManager(Communication connection);  CSVFileManager(Capability capability, Communication connection); void setRootCapability(Capability capability); CSVObject putObjectIntoFolder(CSVObject object, CSVFolder folder,
			String alias); CSVObject putObjectIntoCurrentFolder(CSVObject object, String alias); CSVFile uploadFile(CSVFile file); CSVFolder uploadFolder(CSVFolder folder); CSVFile downloadFile(CSVFile file); CSVFolder downloadFolder(CSVFolder folder); CSVFolder downloadFolder(String alias, CSVFolder fromFolder); CSVObject downloadObject(CSVObject object); CSVFolder downloadFolder(Capability capability); CSVFolder cd(String alias); CSVFolder getShareFolder(); CSVFolder getCurrentFolder(); CSVFolder getParentFolder(); CSVFolder replaceCurrentFolder(); CSVFolder getRootFolder(); void unlinkAliasFromCurrentFolder(String alias); void unLinkAliasFromFolder(String alias, CSVFolder folder); static final String SHARE_FOLDER; }### Answer:
@Test public void testFileDownload() throws ServerCommunicationException, InvalidWriteEnablerException, ImmutableFileExistsException, RemoteFileDoesNotExistException, IOException, FailedToVerifySignatureException { testFileUpload(); File myFile = new File(this.decryptedOutputFile); CSVFile download = new CSVFile(csvFile.getCapability(), myFile); download = this.fileManager.downloadFile(download); Assert.assertTrue(download.isValid()); Assert.assertTrue(myFile.exists()); File testFile = new File(this.testfile); byte[] org = FileUtils.readDataBinary(new FileInputStream(testFile), (int) testFile.length()); byte[] downloaded = FileUtils.readDataBinary( new FileInputStream(myFile), (int) myFile.length()); Assert.assertArrayEquals(org, downloaded); }
@Test(expected = RemoteFileDoesNotExistException.class) public void testGetInvalidFile() throws FileNotFoundException, ServerCommunicationException, InvalidWriteEnablerException, ImmutableFileExistsException, RemoteFileDoesNotExistException, FailedToVerifySignatureException { this.csvFile = new CSVFile(new File(this.testfile)); this.fileManager.downloadFile(csvFile); }