/** * Extends the credentials for a previously initiated upload. <p>Requires WRITE permission on namespace</p> * * @param namespace the namespace. * @param businessObjectDefinitionName the business object definition name. * @param businessObjectFormatUsage the business object format usage. * @param businessObjectFormatFileType the business object format file type. * @param businessObjectFormatVersion the business object format version. * @param partitionValue the partition value. * @param businessObjectDataVersion the business object data version. * * @return the extended credentials. */ @RequestMapping(value = "/upload/single/credential/extension/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}/partitionValues/{partitionValue}" + "/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_UPLOAD_EXTEND_CREDENTIALS_GET) public UploadSingleCredentialExtensionResponse extendUploadSingleCredentials(@PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage, @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType, @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion) { return uploadDownloadService .extendUploadSingleCredentials(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, businessObjectDataVersion); }
/** * Extends the credentials for a previously initiated upload. <p>Requires WRITE permission on namespace</p> * * @param namespace the namespace. * @param businessObjectDefinitionName the business object definition name. * @param businessObjectFormatUsage the business object format usage. * @param businessObjectFormatFileType the business object format file type. * @param businessObjectFormatVersion the business object format version. * @param partitionValue the partition value. * @param businessObjectDataVersion the business object data version. * * @return the extended credentials. */ @RequestMapping(value = "/upload/single/credential/extension/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}/partitionValues/{partitionValue}" + "/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_UPLOAD_EXTEND_CREDENTIALS_GET) public UploadSingleCredentialExtensionResponse extendUploadSingleCredentials(@PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage, @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType, @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion) { return uploadDownloadService .extendUploadSingleCredentials(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, businessObjectDataVersion); }
@Test public void testExtendUploadSingleCredentials() { // Create a response. UploadSingleCredentialExtensionResponse response = new UploadSingleCredentialExtensionResponse(AWS_ASSUMED_ROLE_ACCESS_KEY, AWS_ASSUMED_ROLE_SECRET_KEY, AWS_ASSUMED_ROLE_SESSION_TOKEN, AWS_ASSUMED_ROLE_SESSION_EXPIRATION_TIME); // Mock the external calls. when(uploadDownloadService .extendUploadSingleCredentials(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, DATA_VERSION)) .thenReturn(response); // Call the method under test. UploadSingleCredentialExtensionResponse result = uploadDownloadRestController .extendUploadSingleCredentials(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, DATA_VERSION); // Verify the external calls. verify(uploadDownloadService) .extendUploadSingleCredentials(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, DATA_VERSION); verifyNoMoreInteractionsHelper(); // Validate the results. assertEquals(response, result); }
/** * Extends the credentials of an in-progress upload. * * @param businessObjectData the business object data for the in-progress upload. * * @return the upload single credential extension response. */ private UploadSingleCredentialExtensionResponse extendUploadSingleCredentials(BusinessObjectData businessObjectData) { return uploadDownloadService.extendUploadSingleCredentials(businessObjectData.getNamespace(), businessObjectData.getBusinessObjectDefinitionName(), businessObjectData.getBusinessObjectFormatUsage(), businessObjectData.getBusinessObjectFormatFileType(), businessObjectData.getBusinessObjectFormatVersion(), businessObjectData.getPartitionValue(), businessObjectData.getVersion()); }