use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpertKey in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertServiceTest method testDeleteBusinessObjectDefinitionSubjectMatterExpert.
@Test
public void testDeleteBusinessObjectDefinitionSubjectMatterExpert() {
// Create a business object definition subject matter expert key.
BusinessObjectDefinitionSubjectMatterExpertKey key = new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID);
// Create and persist the relative database entities.
BusinessObjectDefinitionSubjectMatterExpertEntity businessObjectDefinitionSubjectMatterExpertEntity = businessObjectDefinitionSubjectMatterExpertDaoTestHelper.createBusinessObjectDefinitionSubjectMatterExpertEntity(key);
// Validate that this business object definition subject matter expert exists.
assertNotNull(businessObjectDefinitionSubjectMatterExpertDao.getBusinessObjectDefinitionSubjectMatterExpertByKey(key));
// Delete this business object definition subject matter expert.
BusinessObjectDefinitionSubjectMatterExpert deletedBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertService.deleteBusinessObjectDefinitionSubjectMatterExpert(key);
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionSubjectMatterExpert(businessObjectDefinitionSubjectMatterExpertEntity.getId(), key), deletedBusinessObjectDefinitionSubjectMatterExpert);
// Ensure that this business object definition subject matter expert is no longer there.
assertNull(businessObjectDefinitionSubjectMatterExpertDao.getBusinessObjectDefinitionSubjectMatterExpertByKey(key));
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpertKey in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertServiceTest method testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition.
@Test
public void testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition() throws Exception {
// Create business object definition subject matter expert keys. The keys are listed out of order to validate the sorting.
List<BusinessObjectDefinitionSubjectMatterExpertKey> keys = Arrays.asList(new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID_2), new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID));
// Create and persist the relative database entities.
for (BusinessObjectDefinitionSubjectMatterExpertKey key : keys) {
businessObjectDefinitionSubjectMatterExpertDaoTestHelper.createBusinessObjectDefinitionSubjectMatterExpertEntity(key);
}
// Get a list of business object definition subject matter expert keys for the specified business object definition.
BusinessObjectDefinitionSubjectMatterExpertKeys resultBusinessObjectDefinitionSubjectMatterExperts = businessObjectDefinitionSubjectMatterExpertService.getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionSubjectMatterExpertKeys(Arrays.asList(keys.get(1), keys.get(0))), resultBusinessObjectDefinitionSubjectMatterExperts);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpertKey in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertServiceTest method testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinitionTrimParameters.
@Test
public void testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinitionTrimParameters() {
// Create and persist business object definition subject matter expert entities.
businessObjectDefinitionSubjectMatterExpertDaoTestHelper.createBusinessObjectDefinitionSubjectMatterExpertEntity(new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID_2));
businessObjectDefinitionSubjectMatterExpertDaoTestHelper.createBusinessObjectDefinitionSubjectMatterExpertEntity(new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID));
// Get a list of business object definition subject matter expert keys using input parameters with leading and trailing empty spaces.
BusinessObjectDefinitionSubjectMatterExpertKeys resultBusinessObjectDefinitionSubjectMatterExpertKeys = businessObjectDefinitionSubjectMatterExpertService.getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(new BusinessObjectDefinitionKey(addWhitespace(BDEF_NAMESPACE), addWhitespace(BDEF_NAME)));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionSubjectMatterExpertKeys(Arrays.asList(new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID), new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID_2))), resultBusinessObjectDefinitionSubjectMatterExpertKeys);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpertKey in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertRestControllerTest method testDeleteBusinessObjectDefinitionSubjectMatterExpert.
@Test
public void testDeleteBusinessObjectDefinitionSubjectMatterExpert() {
// Create a business object definition subject matter expert key.
BusinessObjectDefinitionSubjectMatterExpertKey key = new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID);
BusinessObjectDefinitionSubjectMatterExpert businessObjectDefinitionSubjectMatterExpert = new BusinessObjectDefinitionSubjectMatterExpert(ID, key);
when(businessObjectDefinitionSubjectMatterExpertService.deleteBusinessObjectDefinitionSubjectMatterExpert(key)).thenReturn(businessObjectDefinitionSubjectMatterExpert);
// Delete this business object definition subject matter expert.
BusinessObjectDefinitionSubjectMatterExpert deletedBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertRestController.deleteBusinessObjectDefinitionSubjectMatterExpert(BDEF_NAMESPACE, BDEF_NAME, USER_ID);
// Verify the external calls.
verify(businessObjectDefinitionSubjectMatterExpertService).deleteBusinessObjectDefinitionSubjectMatterExpert(key);
verifyNoMoreInteractions(businessObjectDefinitionSubjectMatterExpertService);
// Validate the returned object.
assertEquals(businessObjectDefinitionSubjectMatterExpert, deletedBusinessObjectDefinitionSubjectMatterExpert);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpertKey in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertRestControllerTest method testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition.
@Test
public void testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition() throws Exception {
// Create business object definition subject matter expert keys. The keys are listed out of order to validate the sorting.
List<BusinessObjectDefinitionSubjectMatterExpertKey> keys = Arrays.asList(new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID_2), new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID));
BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME);
BusinessObjectDefinitionSubjectMatterExpertKeys businessObjectDefinitionSubjectMatterExpertKeys = new BusinessObjectDefinitionSubjectMatterExpertKeys(keys);
when(businessObjectDefinitionSubjectMatterExpertService.getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(businessObjectDefinitionKey)).thenReturn(businessObjectDefinitionSubjectMatterExpertKeys);
// Get a list of business object definition subject matter expert keys for the specified business object definition.
BusinessObjectDefinitionSubjectMatterExpertKeys resultBusinessObjectDefinitionSubjectMatterExperts = businessObjectDefinitionSubjectMatterExpertRestController.getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(BDEF_NAMESPACE, BDEF_NAME);
// Verify the external calls.
verify(businessObjectDefinitionSubjectMatterExpertService).getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(businessObjectDefinitionKey);
verifyNoMoreInteractions(businessObjectDefinitionSubjectMatterExpertService);
// Validate the returned object.
assertEquals(businessObjectDefinitionSubjectMatterExpertKeys, resultBusinessObjectDefinitionSubjectMatterExperts);
}
Aggregations