use of org.finra.herd.model.api.xml.BusinessObjectDefinitionTag in project herd by FINRAOS.
the class BusinessObjectDefinitionTagRestControllerTest method testCreateBusinessObjectDefinitionTag.
@Test
public void testCreateBusinessObjectDefinitionTag() {
// Create a business object definition key.
BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME);
// Create a business object definition tag key.
BusinessObjectDefinitionTagKey businessObjectDefinitionTagKey = new BusinessObjectDefinitionTagKey(businessObjectDefinitionKey, new TagKey(TAG_TYPE, TAG_CODE));
BusinessObjectDefinitionTag businessObjectDefinitionTag = new BusinessObjectDefinitionTag(ID, businessObjectDefinitionTagKey);
BusinessObjectDefinitionTagCreateRequest request = new BusinessObjectDefinitionTagCreateRequest(businessObjectDefinitionTagKey);
when(businessObjectDefinitionTagService.createBusinessObjectDefinitionTag(request)).thenReturn(businessObjectDefinitionTag);
// Create a business object definition tag.
BusinessObjectDefinitionTag result = businessObjectDefinitionTagRestController.createBusinessObjectDefinitionTag(request);
// Verify the external calls.
verify(businessObjectDefinitionTagService).createBusinessObjectDefinitionTag(request);
verifyNoMoreInteractions(businessObjectDefinitionTagService);
// Validate the returned object.
assertEquals(businessObjectDefinitionTag, result);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionTag in project herd by FINRAOS.
the class BusinessObjectDefinitionTagRestControllerTest method testDeleteBusinessObjectDefinitionTag.
@Test
public void testDeleteBusinessObjectDefinitionTag() {
// Create a business object definition tag key.
BusinessObjectDefinitionTagKey businessObjectDefinitionTagKey = new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), new TagKey(TAG_TYPE, TAG_CODE));
BusinessObjectDefinitionTag businessObjectDefinitionTag = new BusinessObjectDefinitionTag(ID, businessObjectDefinitionTagKey);
when(businessObjectDefinitionTagService.deleteBusinessObjectDefinitionTag(businessObjectDefinitionTagKey)).thenReturn(businessObjectDefinitionTag);
// Delete this business object definition tag.
BusinessObjectDefinitionTag result = businessObjectDefinitionTagRestController.deleteBusinessObjectDefinitionTag(BDEF_NAMESPACE, BDEF_NAME, TAG_TYPE, TAG_CODE);
// Verify the external calls.
verify(businessObjectDefinitionTagService).deleteBusinessObjectDefinitionTag(businessObjectDefinitionTagKey);
verifyNoMoreInteractions(businessObjectDefinitionTagService);
// Validate the returned object.
assertEquals(businessObjectDefinitionTag, result);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionTag in project herd by FINRAOS.
the class BusinessObjectDefinitionTagServiceTest method testCreateBusinessObjectDefinitionTagTrimParameters.
@Test
public void testCreateBusinessObjectDefinitionTagTrimParameters() {
// Create and persist a business object definition entity.
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), DATA_PROVIDER_NAME, DESCRIPTION);
// Create and persist a tag entity.
tagDaoTestHelper.createTagEntity(TAG_TYPE, TAG_CODE, TAG_DISPLAY_NAME, TAG_DESCRIPTION);
// Create a business object definition tag using input parameters with leading and trailing empty spaces.
BusinessObjectDefinitionTag result = businessObjectDefinitionTagService.createBusinessObjectDefinitionTag(new BusinessObjectDefinitionTagCreateRequest(new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(addWhitespace(BDEF_NAMESPACE), addWhitespace(BDEF_NAME)), new TagKey(addWhitespace(TAG_TYPE), addWhitespace(TAG_CODE)))));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionTag(result.getId(), new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), new TagKey(TAG_TYPE, TAG_CODE))), result);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionTag in project herd by FINRAOS.
the class BusinessObjectDefinitionTagServiceTest method testCreateBusinessObjectDefinitionTagUpperCaseParameters.
@Test
public void testCreateBusinessObjectDefinitionTagUpperCaseParameters() {
// Create and persist a business object definition entity.
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), DATA_PROVIDER_NAME, DESCRIPTION);
// Create and persist a tag entity.
tagDaoTestHelper.createTagEntity(TAG_TYPE, TAG_CODE, TAG_DISPLAY_NAME, TAG_DESCRIPTION);
// Create a business object definition tag using upper case parameter values.
BusinessObjectDefinitionTag result = businessObjectDefinitionTagService.createBusinessObjectDefinitionTag(new BusinessObjectDefinitionTagCreateRequest(new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(BDEF_NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase()), new TagKey(TAG_TYPE.toUpperCase(), TAG_CODE.toUpperCase()))));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionTag(result.getId(), new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), new TagKey(TAG_TYPE, TAG_CODE))), result);
}
use of org.finra.herd.model.api.xml.BusinessObjectDefinitionTag in project herd by FINRAOS.
the class BusinessObjectDefinitionTagServiceTest method testCreateBusinessObjectDefinitionTag.
@Test
public void testCreateBusinessObjectDefinitionTag() {
// Create a business object definition key.
BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME);
// Create a business object definition tag key.
BusinessObjectDefinitionTagKey businessObjectDefinitionTagKey = new BusinessObjectDefinitionTagKey(businessObjectDefinitionKey, new TagKey(TAG_TYPE, TAG_CODE));
// Create and persist a business object definition entity.
businessObjectDefinitionDaoTestHelper.createBusinessObjectDefinitionEntity(businessObjectDefinitionKey, DATA_PROVIDER_NAME, DESCRIPTION);
// Create and persist a tag entity.
tagDaoTestHelper.createTagEntity(TAG_TYPE, TAG_CODE, TAG_DISPLAY_NAME, TAG_DESCRIPTION);
// Create a business object definition tag.
BusinessObjectDefinitionTag result = businessObjectDefinitionTagService.createBusinessObjectDefinitionTag(new BusinessObjectDefinitionTagCreateRequest(businessObjectDefinitionTagKey));
// Validate the returned object.
assertEquals(new BusinessObjectDefinitionTag(result.getId(), businessObjectDefinitionTagKey), result);
}
Aggregations