/** * Gets a list of manifest files from a list of file names. * * @param fileNames the list of file names. * @param fileSizeBytes the file size in bytes for each manifest file. * * @return the list of manifest files. */ protected List<ManifestFile> getManifestFilesFromFileNames(List<String> fileNames, long fileSizeBytes) { List<ManifestFile> manifestFiles = new ArrayList<>(); for (int i = 0; i < fileNames.size(); i++) { String fileName = fileNames.get(i); ManifestFile manifestFile = new ManifestFile(); manifestFiles.add(manifestFile); manifestFile.setFileName(fileName); manifestFile.setRowCount((long) i); manifestFile.setFileSizeBytes(fileSizeBytes); } return manifestFiles; }
@Test public void testReadJsonManifestNoRowCount() throws IOException { // Get an instance of uploader input manifest object. UploaderInputManifestDto uploaderInputManifestDto = getTestUploaderInputManifestDto(); // Make all the row counts null. for (ManifestFile manifestFile : uploaderInputManifestDto.getManifestFiles()) { manifestFile.setRowCount(null); } // Create and read a uploaderInputManifestDto file. UploaderInputManifestDto resultManifest = uploaderManifestReader.readJsonManifest(createManifestFile(LOCAL_TEMP_PATH_INPUT.toString(), uploaderInputManifestDto)); // Validate the results. assertUploaderManifest(uploaderInputManifestDto, resultManifest); }
manifestFile.setFileName(storageFile.getFilePath().replace(s3KeyPrefix, "")); manifestFile.setFileSizeBytes(storageFile.getFileSizeBytes()); manifestFile.setRowCount(storageFile.getRowCount());
manifestFile.setFileName("testFileName"); manifestFile.setFileSizeBytes(1l); manifestFile.setRowCount(2l); manifestFiles.add(manifestFile);