use of org.finra.herd.model.api.xml.RelationalTableRegistrationCreateRequest in project herd by FINRAOS.
the class RelationalTableRegistrationServiceTest method testRelationalTableRegistrationServiceMethodsNewTransactionPropagation.
/**
* This unit test is to get coverage for the methods that have an explicit annotation for transaction propagation.
*/
@Test
public void testRelationalTableRegistrationServiceMethodsNewTransactionPropagation() {
try {
relationalTableRegistrationServiceImpl.createRelationalTableRegistration(new RelationalTableRegistrationCreateRequest(), APPEND_TO_EXISTING_BUSINESS_OBJECT_DEFINTION_FALSE);
fail();
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.RelationalTableRegistrationCreateRequest in project herd by FINRAOS.
the class RelationalTableRegistrationRestControllerTest method testRelationalTableRegistrationRestController.
@Test
public void testRelationalTableRegistrationRestController() {
RelationalTableRegistrationCreateRequest createRequest = new RelationalTableRegistrationCreateRequest();
createRequest.setNamespace(BDEF_NAMESPACE);
createRequest.setDataProviderName(DATA_PROVIDER_NAME);
createRequest.setBusinessObjectDefinitionName(BDEF_NAME);
createRequest.setBusinessObjectFormatUsage(FORMAT_USAGE_CODE);
createRequest.setRelationalTableName(RELATIONAL_TABLE_NAME);
createRequest.setStorageName(STORAGE_NAME);
BusinessObjectData businessObjectData = new BusinessObjectData();
businessObjectData.setId(businessObjectData.getId());
businessObjectData.setNamespace(BDEF_NAMESPACE);
businessObjectData.setBusinessObjectDefinitionName(BDEF_NAME);
businessObjectData.setBusinessObjectFormatUsage(FORMAT_USAGE_CODE);
businessObjectData.setVersion(0);
businessObjectData.setStatus("VALID");
businessObjectData.setLatestVersion(true);
businessObjectData.setBusinessObjectFormatFileType(FileTypeEntity.RELATIONAL_TABLE_FILE_TYPE);
businessObjectData.setPartitionValue(BusinessObjectDataServiceImpl.NO_PARTITIONING_PARTITION_VALUE);
businessObjectData.setPartitionKey(BusinessObjectDataServiceImpl.NO_PARTITIONING_PARTITION_KEY);
when(relationalTableRegistrationService.createRelationalTableRegistration(createRequest, APPEND_TO_EXISTING_BUSINESS_OBJECT_DEFINTION_FALSE)).thenReturn(businessObjectData);
BusinessObjectData returnedBusinessObjectData = relationalTableRegistrationRestController.createRelationalTableRegistration(createRequest, APPEND_TO_EXISTING_BUSINESS_OBJECT_DEFINTION_FALSE);
// Verify the external calls.
verify(relationalTableRegistrationService).createRelationalTableRegistration(createRequest, APPEND_TO_EXISTING_BUSINESS_OBJECT_DEFINTION_FALSE);
verifyNoMoreInteractions(relationalTableRegistrationService);
// Validate the returned object.
assertEquals(businessObjectData, returnedBusinessObjectData);
}
Aggregations