use of org.finra.herd.model.api.xml.BusinessObjectDataStorageFilesCreateResponse in project herd by FINRAOS.
the class BusinessObjectDataStorageFileServiceTest method testCreateBusinessObjectDataStorageFilesWithStorageDirectory.
@Test
public void testCreateBusinessObjectDataStorageFilesWithStorageDirectory() {
// Add a storage file to a storage unit with a storage directory path.
createData("some/path", false);
BusinessObjectDataStorageFilesCreateRequest request = new BusinessObjectDataStorageFilesCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, null, DATA_VERSION, STORAGE_NAME, Arrays.asList(createFile("some/path/" + FILE_PATH_2, FILE_SIZE_1_KB, ROW_COUNT_1000)), NO_DISCOVER_STORAGE_FILES);
BusinessObjectDataStorageFilesCreateResponse response = businessObjectDataStorageFileService.createBusinessObjectDataStorageFiles(request);
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStorageFilesCreateResponse(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME, request.getStorageFiles(), response);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStorageFilesCreateResponse in project herd by FINRAOS.
the class MockHttpClientOperationsImpl method buildPostBusinessObjectDataStorageFilesResponse.
/**
* Builds a business object data storage files create response.
*
* @param response the response.
* @param uri the URI of the incoming request.
*
* @throws JAXBException if a JAXB error occurred.
*/
private void buildPostBusinessObjectDataStorageFilesResponse(MockCloseableHttpResponse response, URI uri) throws JAXBException {
BusinessObjectDataStorageFilesCreateResponse businessObjectDataStorageFilesCreateResponse = new BusinessObjectDataStorageFilesCreateResponse();
response.setEntity(getHttpEntity(businessObjectDataStorageFilesCreateResponse));
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStorageFilesCreateResponse in project herd by FINRAOS.
the class BusinessObjectDataStorageFileRestControllerTest method testCreateBusinessObjectDataStorageFiles.
@Test
public void testCreateBusinessObjectDataStorageFiles() {
BusinessObjectDataStorageFilesCreateResponse response = new BusinessObjectDataStorageFilesCreateResponse();
BusinessObjectDataStorageFilesCreateRequest request = new BusinessObjectDataStorageFilesCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, null, DATA_VERSION, STORAGE_NAME, null, NO_DISCOVER_STORAGE_FILES);
when(businessObjectDataStorageFileService.createBusinessObjectDataStorageFiles(request)).thenReturn(response);
BusinessObjectDataStorageFilesCreateResponse resultResponse = businessObjectDataStorageFileRestController.createBusinessObjectDataStorageFiles(request);
// Verify the external calls.
verify(businessObjectDataStorageFileService).createBusinessObjectDataStorageFiles(request);
verifyNoMoreInteractions(businessObjectDataStorageFileService);
// Validate the returned object.
assertEquals(response, resultResponse);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStorageFilesCreateResponse in project herd by FINRAOS.
the class BusinessObjectDataStorageFileServiceTest method testCreateBusinessObjectDataStorageFilesTrimParameters.
@Test
public void testCreateBusinessObjectDataStorageFilesTrimParameters() {
createDataWithSubPartitions();
// Create business object data storage files by passing all input parameters with leading and trailing empty spaces.
BusinessObjectDataStorageFilesCreateRequest request = new BusinessObjectDataStorageFilesCreateRequest(addWhitespace(NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE), addWhitespace(FORMAT_FILE_TYPE_CODE), FORMAT_VERSION, addWhitespace(PARTITION_VALUE), addWhitespace(SUB_PARTITION_VALUES), DATA_VERSION, addWhitespace(STORAGE_NAME), Arrays.asList(createFile(addWhitespace(FILE_PATH_2), FILE_SIZE_1_KB, ROW_COUNT_1000)), NO_DISCOVER_STORAGE_FILES);
BusinessObjectDataStorageFilesCreateResponse response = businessObjectDataStorageFileService.createBusinessObjectDataStorageFiles(request);
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStorageFilesCreateResponse(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUB_PARTITION_VALUES, DATA_VERSION, STORAGE_NAME, Arrays.asList(createFile(FILE_PATH_2, FILE_SIZE_1_KB, ROW_COUNT_1000)), response);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStorageFilesCreateResponse in project herd by FINRAOS.
the class BusinessObjectDataStorageFileServiceTest method testCreateBusinessObjectDataStorageFilesS3Managed.
@Test
public void testCreateBusinessObjectDataStorageFilesS3Managed() throws Exception {
createData(null, true, Arrays.asList(testS3KeyPrefix + "/" + FILE_PATH_1));
businessObjectDataServiceTestHelper.prepareTestS3Files(testS3KeyPrefix, localTempPath, Arrays.asList(FILE_PATH_1, FILE_PATH_2));
BusinessObjectDataStorageFilesCreateRequest request = new BusinessObjectDataStorageFilesCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, null, DATA_VERSION, StorageEntity.MANAGED_STORAGE, Arrays.asList(createFile(testS3KeyPrefix + "/" + FILE_PATH_2, FILE_SIZE_1_KB, ROW_COUNT_1000)), NO_DISCOVER_STORAGE_FILES);
BusinessObjectDataStorageFilesCreateResponse response = businessObjectDataStorageFileService.createBusinessObjectDataStorageFiles(request);
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStorageFilesCreateResponse(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, StorageEntity.MANAGED_STORAGE, request.getStorageFiles(), response);
}
Aggregations