test_class.file: herd-code/herd-tools/herd-downloader/src/test/java/org/finra/herd/tools/downloader/DownloaderControllerTest.java
test_class.identifier: DownloaderControllerTest
test_class.superclass: extends AbstractDownloaderTest
test_case.body: @Test
      public void testCreateDownloaderOutputManifestDtoAssertOutputAttributesSetWhenBdataAttributesSet()
      {
          BusinessObjectData businessObjectData = new BusinessObjectData();
          businessObjectData.setAttributes(new ArrayList<>());
          businessObjectData.getAttributes().add(new Attribute("name", "value"));
          StorageUnit storageUnit = new StorageUnit(new Storage("storageName", null, null), null, null, StorageUnitStatusEntity.ENABLED, null, null, null);
          String s3KeyPrefix = "s3KeyPrefix";
          DownloaderOutputManifestDto actual = downloaderController.createDownloaderOutputManifestDto(businessObjectData, storageUnit, s3KeyPrefix);
          assertEquals(1, actual.getAttributes().size());
          assertEquals("value", actual.getAttributes().get("name"));
      }
test_case.class_method_signature: DownloaderControllerTest.testCreateDownloaderOutputManifestDtoAssertOutputAttributesSetWhenBdataAttributesSet()
test_case.full_signature: @Test public void testCreateDownloaderOutputManifestDtoAssertOutputAttributesSetWhenBdataAttributesSet()
test_case.identifier: testCreateDownloaderOutputManifestDtoAssertOutputAttributesSetWhenBdataAttributesSet
test_case.invocations: setAttributes add getAttributes createDownloaderOutputManifestDto assertEquals size getAttributes assertEquals get getAttributes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateDownloaderOutputManifestDtoAssertOutputAttributesSetWhenBdataAttributesSet()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DownloaderController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DownloaderController.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: businessObjectDataHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataHelper businessObjectDataHelper;
focal_class.type: BusinessObjectDataHelper
focal_class.var_name: businessObjectDataHelper
focal_class.declarator: configurationHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ConfigurationHelper configurationHelper;
focal_class.type: ConfigurationHelper
focal_class.var_name: configurationHelper
focal_class.declarator: manifestReader
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private DownloaderManifestReader manifestReader;
focal_class.type: DownloaderManifestReader
focal_class.var_name: manifestReader
focal_class.declarator: manifestWriter
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private DownloaderManifestWriter manifestWriter;
focal_class.type: DownloaderManifestWriter
focal_class.var_name: manifestWriter
focal_class.declarator: downloaderWebClient
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private DownloaderWebClient downloaderWebClient;
focal_class.type: DownloaderWebClient
focal_class.var_name: downloaderWebClient
focal_class.declarator: storageFileHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageFileHelper storageFileHelper;
focal_class.type: StorageFileHelper
focal_class.var_name: storageFileHelper
focal_class.declarator: storageHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageHelper storageHelper;
focal_class.type: StorageHelper
focal_class.var_name: storageHelper
focal_class.declarator: OUTPUT_MANIFEST_FILE_NAME = "manifest.json"
focal_class.modifier: private static final
focal_class.original_string: private static final String OUTPUT_MANIFEST_FILE_NAME = "manifest.json";
focal_class.type: String
focal_class.var_name: OUTPUT_MANIFEST_FILE_NAME
focal_class.file: herd-code/herd-tools/herd-downloader/src/main/java/org/finra/herd/tools/downloader/DownloaderController.java
focal_class.identifier: DownloaderController
focal_class.class_method_signature: DownloaderController.performDownload(RegServerAccessParamsDto regServerAccessParamsDto, File manifestPath,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto)
focal_class.full_signature: @SuppressFBWarnings(value = {"BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"}, justification = "manifestReader.readJsonManifest will always return an DownloaderInputManifestDto object. targetLocalDirectory.list().length will not" + " return a NullPointerException.") public void performDownload(RegServerAccessParamsDto regServerAccessParamsDto, File manifestPath,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto)
focal_class.identifier: performDownload
focal_class.modifiers: @SuppressFBWarnings(value = {"BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"}, justification = "manifestReader.readJsonManifest will always return an DownloaderInputManifestDto object. targetLocalDirectory.list().length will not" + " return a NullPointerException.") public
focal_class.parameters: (RegServerAccessParamsDto regServerAccessParamsDto, File manifestPath,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto)
focal_class.return: void
focal_class.signature: void performDownload(RegServerAccessParamsDto regServerAccessParamsDto, File manifestPath,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto)
focal_class.class_method_signature: DownloaderController.logLocalDirectoryContents(File directory)
focal_class.full_signature: private void logLocalDirectoryContents(File directory)
focal_class.identifier: logLocalDirectoryContents
focal_class.modifiers: private
focal_class.parameters: (File directory)
focal_class.return: void
focal_class.signature: void logLocalDirectoryContents(File directory)
focal_class.class_method_signature: DownloaderController.createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_class.full_signature: protected DownloaderOutputManifestDto createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_class.identifier: createDownloaderOutputManifestDto
focal_class.modifiers: protected
focal_class.parameters: (BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_class.return: DownloaderOutputManifestDto
focal_class.signature: DownloaderOutputManifestDto createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_class.superclass: extends DataBridgeController
focal_method.body: protected DownloaderOutputManifestDto createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
      {
          DownloaderOutputManifestDto downloaderOutputManifestDto = new DownloaderOutputManifestDto();
  
          // Populate basic fields.
          downloaderOutputManifestDto.setNamespace(businessObjectData.getNamespace());
          downloaderOutputManifestDto.setBusinessObjectDefinitionName(businessObjectData.getBusinessObjectDefinitionName());
          downloaderOutputManifestDto.setBusinessObjectFormatUsage(businessObjectData.getBusinessObjectFormatUsage());
          downloaderOutputManifestDto.setBusinessObjectFormatFileType(businessObjectData.getBusinessObjectFormatFileType());
          downloaderOutputManifestDto.setBusinessObjectFormatVersion(String.valueOf(businessObjectData.getBusinessObjectFormatVersion()));
          downloaderOutputManifestDto.setPartitionKey(businessObjectData.getPartitionKey());
          downloaderOutputManifestDto.setPartitionValue(businessObjectData.getPartitionValue());
          downloaderOutputManifestDto.setSubPartitionValues(businessObjectData.getSubPartitionValues());
          downloaderOutputManifestDto.setBusinessObjectDataVersion(String.valueOf(businessObjectData.getVersion()));
          downloaderOutputManifestDto.setStorageName(storageUnit.getStorage().getName());
  
          // Build a list of manifest files with paths relative to the S3 key prefix.
          List<ManifestFile> manifestFiles = new ArrayList<>();
          downloaderOutputManifestDto.setManifestFiles(manifestFiles);
          if (!CollectionUtils.isEmpty(storageUnit.getStorageFiles()))
          {
              for (StorageFile storageFile : storageUnit.getStorageFiles())
              {
                  ManifestFile manifestFile = new ManifestFile();
                  manifestFiles.add(manifestFile);
                  manifestFile.setFileName(storageFile.getFilePath().replace(s3KeyPrefix, ""));
                  manifestFile.setFileSizeBytes(storageFile.getFileSizeBytes());
                  manifestFile.setRowCount(storageFile.getRowCount());
              }
          }
  
          // Populate the attributes.
          HashMap<String, String> attributes = new HashMap<>();
          if (!CollectionUtils.isEmpty(businessObjectData.getAttributes()))
          {
              for (Attribute attribute : businessObjectData.getAttributes())
              {
                  attributes.put(attribute.getName(), attribute.getValue());
              }
          }
          downloaderOutputManifestDto.setAttributes(attributes);
  
          // Populate the business object data parents and children.
          downloaderOutputManifestDto.setBusinessObjectDataParents(businessObjectData.getBusinessObjectDataParents());
          downloaderOutputManifestDto.setBusinessObjectDataChildren(businessObjectData.getBusinessObjectDataChildren());
  
          return downloaderOutputManifestDto;
      }
focal_method.class_method_signature: DownloaderController.createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_method.full_signature: protected DownloaderOutputManifestDto createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_method.identifier: createDownloaderOutputManifestDto
focal_method.invocations: setNamespace getNamespace setBusinessObjectDefinitionName getBusinessObjectDefinitionName setBusinessObjectFormatUsage getBusinessObjectFormatUsage setBusinessObjectFormatFileType getBusinessObjectFormatFileType setBusinessObjectFormatVersion valueOf getBusinessObjectFormatVersion setPartitionKey getPartitionKey setPartitionValue getPartitionValue setSubPartitionValues getSubPartitionValues setBusinessObjectDataVersion valueOf getVersion setStorageName getName getStorage setManifestFiles isEmpty getStorageFiles getStorageFiles add setFileName replace getFilePath setFileSizeBytes getFileSizeBytes setRowCount getRowCount isEmpty getAttributes getAttributes put getName getValue setAttributes setBusinessObjectDataParents getBusinessObjectDataParents setBusinessObjectDataChildren getBusinessObjectDataChildren
focal_method.modifiers: protected
focal_method.parameters: (BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)
focal_method.return: DownloaderOutputManifestDto
focal_method.signature: DownloaderOutputManifestDto createDownloaderOutputManifestDto(BusinessObjectData businessObjectData, StorageUnit storageUnit, String s3KeyPrefix)