@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); }
businessObjectFormat.setAttributes(attributes); for (BusinessObjectFormatAttributeEntity attributeEntity : businessObjectFormatEntity.getAttributes())
businessObjectFormat.setAttributes(attributes); for (BusinessObjectFormatAttributeEntity attributeEntity : businessObjectFormatEntity.getAttributes())
expectedBusinessObjectFormat.setBusinessObjectFormatExternalInterfaces(new ArrayList<>()); expectedBusinessObjectFormat.setAttributeDefinitions(new ArrayList<>()); expectedBusinessObjectFormat.setAttributes(Arrays.asList( new Attribute(configurationHelper.getProperty(ConfigurationValue.BUSINESS_OBJECT_FORMAT_ATTRIBUTE_NAME_RELATIONAL_SCHEMA_NAME), relationalSchemaName),
expectedBusinessObjectFormat.setBusinessObjectFormatExternalInterfaces(new ArrayList<>()); expectedBusinessObjectFormat.setAttributeDefinitions(new ArrayList<>()); expectedBusinessObjectFormat.setAttributes(Arrays.asList( new Attribute(configurationHelper.getProperty(ConfigurationValue.BUSINESS_OBJECT_FORMAT_ATTRIBUTE_NAME_RELATIONAL_SCHEMA_NAME), relationalSchemaName),
copy.attributes = null; if (copyAttributes!= null) { copy.setAttributes(copyAttributes);
copy.attributes = null; if (copyAttributes!= null) { copy.setAttributes(copyAttributes);
copy.attributes = null; if (copyAttributes!= null) { copy.setAttributes(copyAttributes);