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);
}
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);
}
Aggregations