@Test public void testInitiateDownloadSingle() { // Create the upload data. UploadSingleInitiationResponse uploadSingleInitiationResponse = uploadDownloadServiceTestHelper.createUploadedFileData(BusinessObjectDataStatusEntity.VALID); // Initiate the download against the uploaded data (i.e. the target business object data). DownloadSingleInitiationResponse downloadSingleInitiationResponse = initiateDownload(uploadSingleInitiationResponse.getTargetBusinessObjectData()); // Validate the download initiation response. uploadDownloadServiceTestHelper.validateDownloadSingleInitiationResponse(uploadSingleInitiationResponse, downloadSingleInitiationResponse); }
/** * Validates a download single initiation response as compared to the upload initiation response. * * @param uploadSingleInitiationResponse the upload single initiation response. * @param downloadSingleInitiationResponse the download single initiation response. */ public void validateDownloadSingleInitiationResponse(UploadSingleInitiationResponse uploadSingleInitiationResponse, DownloadSingleInitiationResponse downloadSingleInitiationResponse) { BusinessObjectData targetBusinessObjectData = uploadSingleInitiationResponse.getTargetBusinessObjectData(); validateDownloadSingleInitiationResponse(targetBusinessObjectData.getNamespace(), targetBusinessObjectData.getBusinessObjectDefinitionName(), targetBusinessObjectData.getBusinessObjectFormatUsage(), targetBusinessObjectData.getBusinessObjectFormatFileType(), targetBusinessObjectData.getBusinessObjectFormatVersion(), targetBusinessObjectData.getAttributes(), targetBusinessObjectData.getStorageUnits().get(0).getStorageFiles().get(0).getFileSizeBytes(), downloadSingleInitiationResponse); }