use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpert in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertServiceTest method testCreateBusinessObjectDefinitionSubjectMatterExpert.
@Test
public void testCreateBusinessObjectDefinitionSubjectMatterExpert() {
// 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.
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(BDEF_NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME, DESCRIPTION);
// Create a business object definition subject matter expert.
BusinessObjectDefinitionSubjectMatterExpert resultBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertService.createBusinessObjectDefinitionSubjectMatterExpert(new BusinessObjectDefinitionSubjectMatterExpertCreateRequest(key));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionSubjectMatterExpert(resultBusinessObjectDefinitionSubjectMatterExpert.getId(), key), resultBusinessObjectDefinitionSubjectMatterExpert);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionSubjectMatterExpert in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertServiceTest method testDeleteBusinessObjectDefinitionSubjectMatterExpertTrimParameters.
@Test
public void testDeleteBusinessObjectDefinitionSubjectMatterExpertTrimParameters() {
// Create a business object definition subject matter expert key.
BusinessObjectDefinitionSubjectMatterExpertKey key = new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID);
// Create and persist a business object definition subject matter expert.
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 using input parameters with leading and trailing empty spaces.
BusinessObjectDefinitionSubjectMatterExpert deletedBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertService.deleteBusinessObjectDefinitionSubjectMatterExpert(new BusinessObjectDefinitionSubjectMatterExpertKey(addWhitespace(BDEF_NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(USER_ID)));
// 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.BusinessObjectDefinitionSubjectMatterExpert 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.BusinessObjectDefinitionSubjectMatterExpert 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.BusinessObjectDefinitionSubjectMatterExpert in project herd by FINRAOS.
the class BusinessObjectDefinitionSubjectMatterExpertRestControllerTest method testCreateBusinessObjectDefinitionSubjectMatterExpert.
@Test
public void testCreateBusinessObjectDefinitionSubjectMatterExpert() {
// Create a business object definition subject matter expert key.
BusinessObjectDefinitionSubjectMatterExpertKey key = new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID);
BusinessObjectDefinitionSubjectMatterExpertCreateRequest request = new BusinessObjectDefinitionSubjectMatterExpertCreateRequest(key);
BusinessObjectDefinitionSubjectMatterExpert businessObjectDefinitionSubjectMatterExpert = new BusinessObjectDefinitionSubjectMatterExpert(ID, key);
when(businessObjectDefinitionSubjectMatterExpertService.createBusinessObjectDefinitionSubjectMatterExpert(request)).thenReturn(businessObjectDefinitionSubjectMatterExpert);
// Create a business object definition subject matter expert.
BusinessObjectDefinitionSubjectMatterExpert resultBusinessObjectDefinitionSubjectMatterExpert = businessObjectDefinitionSubjectMatterExpertRestController.createBusinessObjectDefinitionSubjectMatterExpert(request);
// Verify the external calls.
verify(businessObjectDefinitionSubjectMatterExpertService).createBusinessObjectDefinitionSubjectMatterExpert(request);
verifyNoMoreInteractions(businessObjectDefinitionSubjectMatterExpertService);
// Validate the returned object.
assertEquals(businessObjectDefinitionSubjectMatterExpert, resultBusinessObjectDefinitionSubjectMatterExpert);
}
Aggregations