/** * Download a single business object data storage file * * @param downloadBusinessObjectDataStorageFileSingleInitiationRequest * * @return the download business object data storage file single initiation response */ @RequestMapping(value = "/download/businessObjectDataStorageFile/single/initiation", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_DOWNLOAD_BUSINESS_OBJECT_DATA_STORAGE_FILE_POST) public DownloadBusinessObjectDataStorageFileSingleInitiationResponse initiateDownloadSingleBusinessObjectDataStorageFile( @RequestBody DownloadBusinessObjectDataStorageFileSingleInitiationRequest downloadBusinessObjectDataStorageFileSingleInitiationRequest) { return uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest); } }
/** * Download a single business object data storage file * * @param downloadBusinessObjectDataStorageFileSingleInitiationRequest * * @return the download business object data storage file single initiation response */ @RequestMapping(value = "/download/businessObjectDataStorageFile/single/initiation", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_DOWNLOAD_BUSINESS_OBJECT_DATA_STORAGE_FILE_POST) public DownloadBusinessObjectDataStorageFileSingleInitiationResponse initiateDownloadSingleBusinessObjectDataStorageFile( @RequestBody DownloadBusinessObjectDataStorageFileSingleInitiationRequest downloadBusinessObjectDataStorageFileSingleInitiationRequest) { return uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest); } }
@Test public void testInitiateDownloadSingleBusinessObjectDataStorageFile() { // Create a business object data storage file key. BusinessObjectDataStorageFileKey businessObjectDataStorageFileKey = new BusinessObjectDataStorageFileKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME, DIRECTORY_PATH + FILE_NAME); // Create a request. DownloadBusinessObjectDataStorageFileSingleInitiationRequest downloadBusinessObjectDataStorageFileSingleInitiationRequest = new DownloadBusinessObjectDataStorageFileSingleInitiationRequest(businessObjectDataStorageFileKey); // Create a response. DownloadBusinessObjectDataStorageFileSingleInitiationResponse downloadBusinessObjectDataStorageFileSingleInitiationResponse = new DownloadBusinessObjectDataStorageFileSingleInitiationResponse(businessObjectDataStorageFileKey, S3_BUCKET_NAME, AWS_ASSUMED_ROLE_ACCESS_KEY, AWS_ASSUMED_ROLE_SECRET_KEY, AWS_ASSUMED_ROLE_SESSION_TOKEN, AWS_ASSUMED_ROLE_SESSION_EXPIRATION_TIME, AWS_PRE_SIGNED_URL); // Mock the external calls. when(uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest)) .thenReturn(downloadBusinessObjectDataStorageFileSingleInitiationResponse); // Call the method under test. DownloadBusinessObjectDataStorageFileSingleInitiationResponse result = uploadDownloadRestController.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest); // Verify the external calls. verify(uploadDownloadService).initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest); verifyNoMoreInteractionsHelper(); // Validate the results. assertEquals("Download business object data storage file single initiation response does not equal result", downloadBusinessObjectDataStorageFileSingleInitiationResponse, result); }
uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest);
uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest);
uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest);
uploadDownloadService.initiateDownloadSingleBusinessObjectDataStorageFile(downloadBusinessObjectDataStorageFileSingleInitiationRequest);