Search in sources :

Example 1 with BusinessObjectDefinitionColumnKeys

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;
}
Also used : BusinessObjectDefinitionColumnKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys) BusinessObjectDefinitionEntity(org.finra.herd.model.jpa.BusinessObjectDefinitionEntity) BusinessObjectDefinitionColumnEntity(org.finra.herd.model.jpa.BusinessObjectDefinitionColumnEntity)

Example 2 with 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);
}
Also used : BusinessObjectDefinitionColumnKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) BusinessObjectDefinitionColumnKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKey) Test(org.junit.Test)

Example 3 with BusinessObjectDefinitionColumnKeys

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);
}
Also used : BusinessObjectDefinitionColumnKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) BusinessObjectDefinitionColumnKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKey) Test(org.junit.Test)

Example 4 with BusinessObjectDefinitionColumnKeys

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);
}
Also used : BusinessObjectDefinitionColumnKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) BusinessObjectDefinitionColumnKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKey) Test(org.junit.Test)

Example 5 with BusinessObjectDefinitionColumnKeys

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);
}
Also used : BusinessObjectDefinitionColumnKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) BusinessObjectDefinitionColumnKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKey) Test(org.junit.Test)

Aggregations

BusinessObjectDefinitionColumnKeys (org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKeys)6 BusinessObjectDefinitionColumnKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionColumnKey)5 BusinessObjectDefinitionKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionKey)5 Test (org.junit.Test)5 BusinessObjectDefinitionColumnEntity (org.finra.herd.model.jpa.BusinessObjectDefinitionColumnEntity)1 BusinessObjectDefinitionEntity (org.finra.herd.model.jpa.BusinessObjectDefinitionEntity)1