use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.
the class DataBridgeControllerTest method testGetStorageNameFromManifestAssertReturnStorageName.
/**
* When manifest specifies storage name Assert return storage name
*/
@Test
public void testGetStorageNameFromManifestAssertReturnStorageName() {
DataBridgeController dataBridgeController = new BasicDataBridgeController();
DataBridgeBaseManifestDto manifest = new DataBridgeBaseManifestDto();
manifest.setStorageName("test");
String value = dataBridgeController.getStorageNameFromManifest(manifest);
assertEquals("test", value);
}
use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.
the class DataBridgeWebClientTest method testGetS3KeyPrefix.
/**
* Calls getS3KeyPrefix() method and makes assertions.
*
* @param namespace the namespace
* @param subPartitionValues the list of sub-partition values
* @param businessObjectDataVersion the version of the business object data, may be null
* @param useSsl specifies whether to use SSL or not
*
* @throws Exception
*/
private void testGetS3KeyPrefix(String namespace, List<String> subPartitionValues, Integer businessObjectDataVersion, String storageName, boolean useSsl) throws Exception {
dataBridgeWebClient.regServerAccessParamsDto.setUseSsl(useSsl);
DataBridgeBaseManifestDto manifest = getUploaderInputManifestDto();
manifest.setNamespace(namespace);
manifest.setSubPartitionValues(subPartitionValues);
manifest.setStorageName(storageName);
Boolean createNewVersion = false;
S3KeyPrefixInformation s3KeyPrefix = dataBridgeWebClient.getS3KeyPrefix(manifest, businessObjectDataVersion, createNewVersion);
assertNotNull("s3KeyPrefix is null", s3KeyPrefix);
}
use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.
the class DataBridgeManifestReaderTest method testReadJsonManifest.
@Test
public void testReadJsonManifest() throws Exception {
DataBridgeBaseManifestDto dataBridgeBaseManifestDto = getDataBridgeBaseManifestDto();
File file = createTempFile(new ObjectMapper().writeValueAsString(dataBridgeBaseManifestDto));
try {
dataBridgeManifestReader.readJsonManifest(file);
} catch (Exception e) {
Assert.fail("unexpected exception was thrown " + e);
}
}
use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.
the class DataBridgeManifestReaderTest method testReadJsonManifestNoPartitionKey.
@Test
public void testReadJsonManifestNoPartitionKey() throws Exception {
DataBridgeBaseManifestDto dataBridgeBaseManifestDto = getDataBridgeBaseManifestDto();
dataBridgeBaseManifestDto.setPartitionKey(null);
testReadJsonManifest(dataBridgeBaseManifestDto, "Manifest business object format partition key must be specified.");
}
use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.
the class DataBridgeManifestReaderTest method testReadJsonManifestNoDefinitionName.
@Test
public void testReadJsonManifestNoDefinitionName() throws Exception {
DataBridgeBaseManifestDto dataBridgeBaseManifestDto = getDataBridgeBaseManifestDto();
dataBridgeBaseManifestDto.setBusinessObjectDefinitionName(null);
testReadJsonManifest(dataBridgeBaseManifestDto, "Manifest business object definition name must be specified.");
}
Aggregations