StorageUnitRestController extends HerdBaseController { @RequestMapping(value = "/storageUnits/upload/credential/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}/partitionValues/{partitionValue}/businessObjectDataVersions/{businessObjectDataVersion}" + "/storageNames/{storageName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_UNIT_UPLOAD_CREDENTIAL_GET) public StorageUnitUploadCredential getStorageUnitUploadCredential(@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, @PathVariable("storageName") String storageName, @RequestParam(value = "subPartitionValues", required = false) String subPartitionValues) { return storageUnitService.getStorageUnitUploadCredential( new BusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, herdStringHelper.splitStringWithDefaultDelimiterEscaped(subPartitionValues), businessObjectDataVersion), null, storageName); }  @RequestMapping(value = "/storageUnits/upload/credential/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}/partitionValues/{partitionValue}/businessObjectDataVersions/{businessObjectDataVersion}" + "/storageNames/{storageName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_UNIT_UPLOAD_CREDENTIAL_GET) StorageUnitUploadCredential getStorageUnitUploadCredential(@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, @PathVariable("storageName") String storageName,
        @RequestParam(value = "subPartitionValues", required = false) String subPartitionValues); @RequestMapping(value = "/storageUnits/download/credential/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}/partitionValues/{partitionValue}/businessObjectDataVersions/{businessObjectDataVersion}" + "/storageNames/{storageName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_UNIT_DOWNLOAD_CREDENTIAL_GET) StorageUnitDownloadCredential getStorageUnitDownloadCredential(@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, @PathVariable("storageName") String storageName,
        @RequestParam(value = "subPartitionValues", required = false) String subPartitionValues);  }
@Test public void getStorageUnitUploadCredential() { BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION); String delimitedSubPartitionValues = String.join("|", SUBPARTITION_VALUES); StorageUnitUploadCredential storageUnitUploadCredential = new StorageUnitUploadCredential( new AwsCredential(AWS_ASSUMED_ROLE_ACCESS_KEY, AWS_ASSUMED_ROLE_SECRET_KEY, AWS_ASSUMED_ROLE_SESSION_TOKEN, AWS_ASSUMED_ROLE_SESSION_EXPIRATION_TIME), AWS_KMS_KEY_ID); when(herdStringHelper.splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues)).thenReturn(SUBPARTITION_VALUES); when(storageUnitService.getStorageUnitUploadCredential(businessObjectDataKey, null, STORAGE_NAME)).thenReturn(storageUnitUploadCredential); StorageUnitUploadCredential result = storageUnitRestController .getStorageUnitUploadCredential(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, DATA_VERSION, STORAGE_NAME, delimitedSubPartitionValues); verify(herdStringHelper).splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues); verify(storageUnitService).getStorageUnitUploadCredential(businessObjectDataKey, null, STORAGE_NAME); verifyNoMoreInteractionsHelper(); assertEquals(storageUnitUploadCredential, result); }