Search in sources :

Example 1 with BusinessObjectDefinitionKeys

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceImpl method getBusinessObjectDefinitions.

@Override
public BusinessObjectDefinitionKeys getBusinessObjectDefinitions(String namespaceCode) {
    // Validate and trim the namespace code.
    Assert.hasText(namespaceCode, "A namespace must be specified.");
    // Retrieve and return the list of business object definitions
    BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys();
    businessObjectDefinitionKeys.getBusinessObjectDefinitionKeys().addAll(businessObjectDefinitionDao.getBusinessObjectDefinitionKeysByNamespace(namespaceCode.trim()));
    return businessObjectDefinitionKeys;
}
Also used : BusinessObjectDefinitionKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys)

Example 2 with BusinessObjectDefinitionKeys

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testGetBusinessObjectDefinitionsEmptyList.

@Test
public void testGetBusinessObjectDefinitionsEmptyList() throws Exception {
    // Retrieve an empty list of business object definition keys.
    BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionService.getBusinessObjectDefinitions("I_DO_NOT_EXIST");
    // Validate the returned object.
    assertNotNull(resultKeys);
    assertEquals(0, resultKeys.getBusinessObjectDefinitionKeys().size());
}
Also used : BusinessObjectDefinitionKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys) Test(org.junit.Test)

Example 3 with BusinessObjectDefinitionKeys

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testGetBusinessObjectDefinitionsTrimParameters.

@Test
public void testGetBusinessObjectDefinitionsTrimParameters() {
    // 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 namespace value with leading and trailing empty spaces.
    BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionService.getBusinessObjectDefinitions(addWhitespace(NAMESPACE));
    // Validate the returned object.
    assertEquals(businessObjectDefinitionDaoTestHelper.getExpectedBusinessObjectDefinitionKeysForNamespace(), resultKeys.getBusinessObjectDefinitionKeys());
}
Also used : BusinessObjectDefinitionKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) Test(org.junit.Test)

Example 4 with BusinessObjectDefinitionKeys

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.

the class BusinessObjectDefinitionServiceTest method testGetBusinessObjectDefinitions.

@Test
public void testGetBusinessObjectDefinitions() 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(NAMESPACE);
    // Validate the returned object.
    assertEquals(businessObjectDefinitionDaoTestHelper.getExpectedBusinessObjectDefinitionKeysForNamespace(), resultKeys.getBusinessObjectDefinitionKeys());
}
Also used : BusinessObjectDefinitionKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) Test(org.junit.Test)

Example 5 with BusinessObjectDefinitionKeys

use of org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys in project herd by FINRAOS.

the class BusinessObjectDefinitionRestControllerTest method testGetBusinessObjectDefinitions.

@Test
public void testGetBusinessObjectDefinitions() {
    // Create business object definition keys.
    BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys(Arrays.asList(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME)));
    // Mock the external calls.
    when(businessObjectDefinitionService.getBusinessObjectDefinitions()).thenReturn(businessObjectDefinitionKeys);
    // Call the method under test.
    BusinessObjectDefinitionKeys result = businessObjectDefinitionRestController.getBusinessObjectDefinitions();
    // Verify the external calls.
    verify(businessObjectDefinitionService).getBusinessObjectDefinitions();
    verifyNoMoreInteractions(businessObjectDefinitionService);
    // Validate the results.
    assertEquals(businessObjectDefinitionKeys, result);
}
Also used : BusinessObjectDefinitionKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys) BusinessObjectDefinitionKey(org.finra.herd.model.api.xml.BusinessObjectDefinitionKey) Test(org.junit.Test)

Aggregations

BusinessObjectDefinitionKeys (org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys)10 Test (org.junit.Test)8 BusinessObjectDefinitionKey (org.finra.herd.model.api.xml.BusinessObjectDefinitionKey)7