Assert.notEmpty(manifest.getManifestFiles(), "Manifest must contain at least 1 file."); for (ManifestFile manifestFile : manifest.getManifestFiles())
List<ManifestFile> localFiles = manifest.getManifestFiles();
List<ManifestFile> localFiles = manifest.getManifestFiles();
@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); }
List<File> sourceFiles = getValidatedLocalFiles(params.getLocalPath(), manifest.getManifestFiles());
/** * Validates an uploader input manifest instance. * * @param expectedUploaderInputManifest the expected uploader input manifest instance * @param actualUploaderInputManifest the actual instance of the uploader input manifest to be validated */ private void assertUploaderManifest(UploaderInputManifestDto expectedUploaderInputManifest, UploaderInputManifestDto actualUploaderInputManifest) { // Validate all regular fields. assertEquals(expectedUploaderInputManifest.getBusinessObjectDefinitionName(), actualUploaderInputManifest.getBusinessObjectDefinitionName()); assertEquals(expectedUploaderInputManifest.getBusinessObjectFormatUsage(), actualUploaderInputManifest.getBusinessObjectFormatUsage()); assertEquals(expectedUploaderInputManifest.getBusinessObjectFormatFileType(), actualUploaderInputManifest.getBusinessObjectFormatFileType()); assertEquals(expectedUploaderInputManifest.getBusinessObjectFormatVersion(), actualUploaderInputManifest.getBusinessObjectFormatVersion()); assertEquals(expectedUploaderInputManifest.getPartitionKey(), actualUploaderInputManifest.getPartitionKey()); assertEquals(expectedUploaderInputManifest.getPartitionValue(), actualUploaderInputManifest.getPartitionValue()); // Validate the files by comparing two file list ignoring the order. assertTrue(expectedUploaderInputManifest.getManifestFiles().containsAll(actualUploaderInputManifest.getManifestFiles())); assertTrue(actualUploaderInputManifest.getManifestFiles().containsAll(expectedUploaderInputManifest.getManifestFiles())); // Validate the attributes. assertEquals(expectedUploaderInputManifest.getAttributes(), actualUploaderInputManifest.getAttributes()); // Validate the business object data parents. assertEquals(expectedUploaderInputManifest.getBusinessObjectDataParents(), actualUploaderInputManifest.getBusinessObjectDataParents()); } }