Search in sources :

Example 1 with BusinessObjectFormatAttributesUpdateRequest

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

the class BusinessObjectFormatServiceTest method testUpdateBusinessObjectFormatAttributes.

@Test
public void testUpdateBusinessObjectFormatAttributes() {
    // Create an initial version of a business object format with format description and schema information.
    BusinessObjectFormat originalBusinessObjectFormat = businessObjectFormatServiceTestHelper.createTestBusinessObjectFormat(businessObjectDefinitionServiceTestHelper.getNewAttributes());
    List<Attribute> attributes = businessObjectDefinitionServiceTestHelper.getNewAttributes2();
    BusinessObjectFormatAttributesUpdateRequest request = new BusinessObjectFormatAttributesUpdateRequest(attributes);
    // Perform an update by changing the description and schema.
    BusinessObjectFormat updatedBusinessObjectFormat = businessObjectFormatService.updateBusinessObjectFormatAttributes(new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION), request);
    // Validate the returned object.
    businessObjectFormatServiceTestHelper.validateBusinessObjectFormat(originalBusinessObjectFormat.getId(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, LATEST_VERSION_FLAG_SET, PARTITION_KEY, FORMAT_DESCRIPTION, attributes, businessObjectFormatServiceTestHelper.getTestAttributeDefinitions(), businessObjectFormatServiceTestHelper.getTestSchema(), updatedBusinessObjectFormat);
}
Also used : Attribute(org.finra.herd.model.api.xml.Attribute) BusinessObjectFormatAttributesUpdateRequest(org.finra.herd.model.api.xml.BusinessObjectFormatAttributesUpdateRequest) BusinessObjectFormatKey(org.finra.herd.model.api.xml.BusinessObjectFormatKey) DescriptiveBusinessObjectFormat(org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormat) BusinessObjectFormat(org.finra.herd.model.api.xml.BusinessObjectFormat) Test(org.junit.Test)

Example 2 with BusinessObjectFormatAttributesUpdateRequest

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

the class BusinessObjectFormatRestControllerTest method testUpdateBusinessObjectFormatAttributes.

@Test
public void testUpdateBusinessObjectFormatAttributes() {
    List<Attribute> attributes = businessObjectDefinitionServiceTestHelper.getNewAttributes2();
    BusinessObjectFormat businessObjectFormat = new BusinessObjectFormat();
    businessObjectFormat.setAttributes(attributes);
    BusinessObjectFormatKey businessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION);
    BusinessObjectFormatAttributesUpdateRequest request = new BusinessObjectFormatAttributesUpdateRequest(attributes);
    when(businessObjectFormatService.updateBusinessObjectFormatAttributes(businessObjectFormatKey, request)).thenReturn(businessObjectFormat);
    BusinessObjectFormat updatedBusinessObjectFormat = businessObjectFormatRestController.updateBusinessObjectFormatAttributes(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, request);
    // Verify the external calls.
    verify(businessObjectFormatService).updateBusinessObjectFormatAttributes(businessObjectFormatKey, request);
    verifyNoMoreInteractions(businessObjectFormatService);
    // Validate the returned object.
    assertEquals(businessObjectFormat, updatedBusinessObjectFormat);
}
Also used : Attribute(org.finra.herd.model.api.xml.Attribute) BusinessObjectFormatAttributesUpdateRequest(org.finra.herd.model.api.xml.BusinessObjectFormatAttributesUpdateRequest) BusinessObjectFormatKey(org.finra.herd.model.api.xml.BusinessObjectFormatKey) BusinessObjectFormat(org.finra.herd.model.api.xml.BusinessObjectFormat) AbstractServiceTest(org.finra.herd.service.AbstractServiceTest) Test(org.junit.Test)

Aggregations

Attribute (org.finra.herd.model.api.xml.Attribute)2 BusinessObjectFormat (org.finra.herd.model.api.xml.BusinessObjectFormat)2 BusinessObjectFormatAttributesUpdateRequest (org.finra.herd.model.api.xml.BusinessObjectFormatAttributesUpdateRequest)2 BusinessObjectFormatKey (org.finra.herd.model.api.xml.BusinessObjectFormatKey)2 Test (org.junit.Test)2 DescriptiveBusinessObjectFormat (org.finra.herd.model.api.xml.DescriptiveBusinessObjectFormat)1 AbstractServiceTest (org.finra.herd.service.AbstractServiceTest)1