Search in sources :

Example 6 with BusinessObjectDefinitionKeys

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

Example 7 with BusinessObjectDefinitionKeys

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

Example 8 with BusinessObjectDefinitionKeys

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

Example 9 with BusinessObjectDefinitionKeys

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

Example 10 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() {
    BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys();
    businessObjectDefinitionKeys.getBusinessObjectDefinitionKeys().addAll(businessObjectDefinitionDao.getBusinessObjectDefinitionKeys());
    return businessObjectDefinitionKeys;
}
Also used : BusinessObjectDefinitionKeys(org.finra.herd.model.api.xml.BusinessObjectDefinitionKeys)

Aggregations

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