use of org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionColumnServiceImpl method getBusinessObjectDefinitionColumns.
@Override
public BusinessObjectDefinitionColumnKeys getBusinessObjectDefinitionColumns(BusinessObjectDefinitionKey businessObjectDefinitionKey) {
// Validate and trim the business object definition key.
businessObjectDefinitionHelper.validateBusinessObjectDefinitionKey(businessObjectDefinitionKey);
// Retrieve the business object definition and ensure it exists.
BusinessObjectDefinitionEntity businessObjectDefinitionEntity = businessObjectDefinitionDaoHelper.getBusinessObjectDefinitionEntity(businessObjectDefinitionKey);
// Create and populate a list of business object definition column keys.
BusinessObjectDefinitionColumnKeys businessObjectDefinitionColumnKeys = new BusinessObjectDefinitionColumnKeys();
for (BusinessObjectDefinitionColumnEntity businessObjectDefinitionColumnEntity : businessObjectDefinitionEntity.getColumns()) {
businessObjectDefinitionColumnKeys.getBusinessObjectDefinitionColumnKeys().add(getBusinessObjectDefinitionColumnKey(businessObjectDefinitionColumnEntity));
}
return businessObjectDefinitionColumnKeys;
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionColumnServiceTest method testGetBusinessObjectDefinitionColumnsTrimParameters.
@Test
public void testGetBusinessObjectDefinitionColumnsTrimParameters() {
// Create and persist business object definition column entities.
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2), DESCRIPTION_2);
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), DESCRIPTION);
// Get a list of business object definition column keys using input parameters with leading and trailing empty spaces.
BusinessObjectDefinitionColumnKeys resultBusinessObjectDefinitionColumnKeys = businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumns(new BusinessObjectDefinitionKey(addWhitespace(BDEF_NAMESPACE), addWhitespace(BDEF_NAME)));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionColumnKeys(Lists.newArrayList(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2))), resultBusinessObjectDefinitionColumnKeys);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionColumnServiceTest method testGetBusinessObjectDefinitionColumns.
@Test
public void testGetBusinessObjectDefinitionColumns() {
// Create and persist business object definition column entities.
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2), DESCRIPTION_2);
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), DESCRIPTION);
// Get a list of business object definition column keys.
BusinessObjectDefinitionColumnKeys resultBusinessObjectDefinitionColumnKeys = businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumns(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionColumnKeys(Lists.newArrayList(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2))), resultBusinessObjectDefinitionColumnKeys);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionColumnRestControllerTest method testGetBusinessObjectDefinitionColumns.
@Test
public void testGetBusinessObjectDefinitionColumns() {
// Create and persist business object definition column entities.
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2), DESCRIPTION_2);
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), DESCRIPTION);
BusinessObjectDefinitionColumnKeys businessObjectDefinitionColumnKeys = new BusinessObjectDefinitionColumnKeys(Lists.newArrayList(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2)));
BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME);
when(businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumns(businessObjectDefinitionKey)).thenReturn(businessObjectDefinitionColumnKeys);
// Get a list of business object definition column keys.
BusinessObjectDefinitionColumnKeys resultBusinessObjectDefinitionColumnKeys = businessObjectDefinitionColumnRestController.getBusinessObjectDefinitionColumns(BDEF_NAMESPACE, BDEF_NAME);
// Verify the external calls.
verify(businessObjectDefinitionColumnService).getBusinessObjectDefinitionColumns(businessObjectDefinitionKey);
verifyNoMoreInteractions(businessObjectDefinitionColumnService);
// Validate the returned object.
assertEquals(businessObjectDefinitionColumnKeys, resultBusinessObjectDefinitionColumnKeys);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionColumnServiceTest method testGetBusinessObjectDefinitionColumnsUpperCaseParameters.
@Test
public void testGetBusinessObjectDefinitionColumnsUpperCaseParameters() {
// Create and persist business object definition column entities.
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2), DESCRIPTION_2);
businessObjectDefinitionColumnDaoTestHelper.createBusinessObjectDefinitionColumnEntity(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), DESCRIPTION);
// Get a list of business object definition column keys using upper case parameter values.
BusinessObjectDefinitionColumnKeys resultBusinessObjectDefinitionColumnKeys = businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumns(new BusinessObjectDefinitionKey(BDEF_NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase()));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionColumnKeys(Lists.newArrayList(new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME), new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME_2))), resultBusinessObjectDefinitionColumnKeys);
}
Aggregations