use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionRestControllerTest method testGetBusinessObjectDefinitionsByNamespace.
@Test
public void testGetBusinessObjectDefinitionsByNamespace() {
// Create business object definition keys.
BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys(Arrays.asList(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME)));
// Mock the external calls.
when(businessObjectDefinitionService.getBusinessObjectDefinitions(BDEF_NAMESPACE)).thenReturn(businessObjectDefinitionKeys);
// Call the method under test.
BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionRestController.getBusinessObjectDefinitions(BDEF_NAMESPACE);
// Verify the external calls.
verify(businessObjectDefinitionService).getBusinessObjectDefinitions(BDEF_NAMESPACE);
verifyNoMoreInteractions(businessObjectDefinitionService);
// Validate the results.
assertEquals(businessObjectDefinitionKeys, resultKeys);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionServiceTest method testGetBusinessObjectDefinitionsUpperCaseParameters.
@Test
public void testGetBusinessObjectDefinitionsUpperCaseParameters() {
// Create and persist business object definition entities.
for (BusinessObjectDefinitionKey key : businessObjectDefinitionDaoTestHelper.getTestBusinessObjectDefinitionKeys()) {
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(key.getNamespace(), key.getBusinessObjectDefinitionName(), DATA_PROVIDER_NAME, BDEF_DESCRIPTION, NO_ATTRIBUTES);
}
// Retrieve a list of business object definition keys for the specified namespace using upper case namespace value.
BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionService.getBusinessObjectDefinitions(NAMESPACE.toUpperCase());
// Validate the returned object.
assertEquals(businessObjectDefinitionDaoTestHelper.getExpectedBusinessObjectDefinitionKeysForNamespace(), resultKeys.getBusinessObjectDefinitionKeys());
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionServiceTest method testGetBusinessObjectDefinitionsNoParameters.
@Test
public void testGetBusinessObjectDefinitionsNoParameters() throws Exception {
// Create and persist business object definition entities.
for (BusinessObjectDefinitionKey key : businessObjectDefinitionDaoTestHelper.getTestBusinessObjectDefinitionKeys()) {
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(key.getNamespace(), key.getBusinessObjectDefinitionName(), DATA_PROVIDER_NAME, BDEF_DESCRIPTION, NO_ATTRIBUTES);
}
// Retrieve a list of business object definition keys for the specified namespace.
BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionService.getBusinessObjectDefinitions();
// Validate the returned object.
assertEquals(businessObjectDefinitionDaoTestHelper.getExpectedBusinessObjectDefinitionKeys(), resultKeys.getBusinessObjectDefinitionKeys());
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionServiceTest method testGetBusinessObjectDefinitionsLowerCaseParameters.
@Test
public void testGetBusinessObjectDefinitionsLowerCaseParameters() {
// Create and persist business object definition entities.
for (BusinessObjectDefinitionKey key : businessObjectDefinitionDaoTestHelper.getTestBusinessObjectDefinitionKeys()) {
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(key.getNamespace(), key.getBusinessObjectDefinitionName(), DATA_PROVIDER_NAME, BDEF_DESCRIPTION, NO_ATTRIBUTES);
}
// Retrieve a list of business object definition keys for the specified namespace using lower case namespace value.
BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionService.getBusinessObjectDefinitions(NAMESPACE.toLowerCase());
// Validate the returned object.
assertEquals(businessObjectDefinitionDaoTestHelper.getExpectedBusinessObjectDefinitionKeysForNamespace(), resultKeys.getBusinessObjectDefinitionKeys());
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.
the class BusinessObjectDefinitionServiceImpl method getBusinessObjectDefinitions.
@Override
public BusinessObjectDefinitionKeys getBusinessObjectDefinitions() {
BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys();
businessObjectDefinitionKeys.getBusinessObjectDefinitionKeys().addAll(businessObjectDefinitionDao.getBusinessObjectDefinitionKeys());
return businessObjectDefinitionKeys;
}
Aggregations