FileSystemOperations { @VisibleForTesting public void uploadToRemoteFileAndLocalizeToContainerWorkDir(Path stagingDir, String fileToUpload, String destFilename, Component comp) throws IOException { Path uploadedFilePath = uploadToRemoteFile(stagingDir, fileToUpload); locateRemoteFileToContainerWorkDir(destFilename, comp, uploadedFilePath); } FileSystemOperations(ClientContext clientContext); String downloadAndZip(String remoteDir, String destFileName); String download(String remoteDir, String zipFileName); void deleteFiles(String localUri); @VisibleForTesting void uploadToRemoteFileAndLocalizeToContainerWorkDir(Path stagingDir,
      String fileToUpload, String destFilename, Component comp); Path uploadToRemoteFile(Path stagingDir, String fileToUpload); void validFileSize(String uri); void setPermission(Path destPath, FsPermission permission); static boolean needHdfs(List<String> stringsToCheck); static boolean needHdfs(String content); Set<Path> getUploadedFiles();  }
@Test public void testUploadToRemoteFileAndLocalizeMultipleFiles() throws IOException { Component comp = new Component(); File testFile1 = fileUtils.createFileInTempDir("testFile1"); File testFile2 = fileUtils.createFileInTempDir("testFile2"); fileSystemOperations.uploadToRemoteFileAndLocalizeToContainerWorkDir( stagingDir, testFile1.getAbsolutePath(), "testFileDest1", comp); fileSystemOperations.uploadToRemoteFileAndLocalizeToContainerWorkDir( stagingDir, testFile2.getAbsolutePath(), "testFileDest2", comp); List<ConfigFile> files = comp.getConfiguration().getFiles(); assertEquals(2, files.size()); ConfigFile configFile1 = files.get(0); assertEquals(TypeEnum.STATIC, configFile1.getType()); assertEquals("testFileDest1", configFile1.getDestFile()); File expectedTestFile1 = new File(new File(stagingDir.toString()), "testFile1"); assertEquals(FILE_SCHEME + expectedTestFile1.getAbsolutePath(), configFile1.getSrcFile()); ConfigFile configFile2 = files.get(1); assertEquals(TypeEnum.STATIC, configFile2.getType()); assertEquals("testFileDest2", configFile2.getDestFile()); File expectedTestFile2 = new File(new File(stagingDir.toString()), "testFile2"); assertEquals(FILE_SCHEME + expectedTestFile2.getAbsolutePath(), configFile2.getSrcFile()); }