test_class.declarator: attributeDaoHelper
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private AttributeDaoHelper attributeDaoHelper;
test_class.type: AttributeDaoHelper
test_class.var_name: attributeDaoHelper
test_class.declarator: businessObjectDataHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BusinessObjectDataHelper businessObjectDataHelper;
test_class.type: BusinessObjectDataHelper
test_class.var_name: businessObjectDataHelper
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/AttributeDaoHelperTest.java
test_class.identifier: AttributeDaoHelperTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testValidateAttributesAgainstBusinessObjectDataAttributeDefinitionsRequiredAttributeIsMissing()
      {
          // Create a business object data attribute definition for a required attribute.
          BusinessObjectDataAttributeDefinitionEntity businessObjectDataAttributeDefinitionEntity = new BusinessObjectDataAttributeDefinitionEntity();
          businessObjectDataAttributeDefinitionEntity.setName(ATTRIBUTE_NAME);
  
          // Try to call the method under test.
          try
          {
              attributeDaoHelper
                  .validateAttributesAgainstBusinessObjectDataAttributeDefinitions(NO_ATTRIBUTES, Arrays.asList(businessObjectDataAttributeDefinitionEntity));
              fail();
          }
          catch (IllegalArgumentException e)
          {
              assertEquals(String
                  .format("The business object format has a required attribute \"%s\" which was not specified or has a value which is blank.", ATTRIBUTE_NAME),
                  e.getMessage());
          }
  
          // Verify the external calls.
          verifyNoMoreInteractionsHelper();
      }
test_case.class_method_signature: AttributeDaoHelperTest.testValidateAttributesAgainstBusinessObjectDataAttributeDefinitionsRequiredAttributeIsMissing()
test_case.full_signature: @Test public void testValidateAttributesAgainstBusinessObjectDataAttributeDefinitionsRequiredAttributeIsMissing()
test_case.identifier: testValidateAttributesAgainstBusinessObjectDataAttributeDefinitionsRequiredAttributeIsMissing
test_case.invocations: setName validateAttributesAgainstBusinessObjectDataAttributeDefinitions asList fail assertEquals format getMessage verifyNoMoreInteractionsHelper
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateAttributesAgainstBusinessObjectDataAttributeDefinitionsRequiredAttributeIsMissing()
focal_class.declarator: businessObjectDataHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataHelper businessObjectDataHelper;
focal_class.type: BusinessObjectDataHelper
focal_class.var_name: businessObjectDataHelper
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/AttributeDaoHelper.java
focal_class.identifier: AttributeDaoHelper
focal_class.class_method_signature: AttributeDaoHelper.updateBusinessObjectDataAttributes(BusinessObjectDataEntity businessObjectDataEntity, final List<Attribute> attributes)
focal_class.full_signature: public void updateBusinessObjectDataAttributes(BusinessObjectDataEntity businessObjectDataEntity, final List<Attribute> attributes)
focal_class.identifier: updateBusinessObjectDataAttributes
focal_class.modifiers: public
focal_class.parameters: (BusinessObjectDataEntity businessObjectDataEntity, final List<Attribute> attributes)
focal_class.return: void
focal_class.signature: void updateBusinessObjectDataAttributes(BusinessObjectDataEntity businessObjectDataEntity, final List<Attribute> attributes)
focal_class.class_method_signature: AttributeDaoHelper.validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_class.full_signature: public void validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_class.identifier: validateAttributesAgainstBusinessObjectDataAttributeDefinitions
focal_class.modifiers: public
focal_class.parameters: (final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_class.return: void
focal_class.signature: void validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_method.body: public void validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
      {
          // Build a map of the specified attributes in the request where the key is lower case for case insensitive checks.
          Map<String, String> attributeMap = new HashMap<>();
          if (!CollectionUtils.isEmpty(attributes))
          {
              for (Attribute attribute : attributes)
              {
                  attributeMap.put(attribute.getName().toLowerCase(), attribute.getValue());
              }
          }
  
          // Loop through each attribute definition (i.e. the required attributes) and verify that each attribute
          // definition was specified in the list of attributes and that the specified value has non-blank data.
          for (BusinessObjectDataAttributeDefinitionEntity attributeDefinitionEntity : businessObjectDataAttributeDefinitionEntities)
          {
              String attributeDefinitionName = attributeDefinitionEntity.getName().toLowerCase();
              if (!attributeMap.containsKey(attributeDefinitionName) || StringUtils.isBlank(attributeMap.get(attributeDefinitionName)))
              {
                  throw new IllegalArgumentException(String
                      .format("The business object format has a required attribute \"%s\" which was not specified or has a value which is blank.",
                          attributeDefinitionEntity.getName()));
              }
          }
      }
focal_method.class_method_signature: AttributeDaoHelper.validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_method.full_signature: public void validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_method.identifier: validateAttributesAgainstBusinessObjectDataAttributeDefinitions
focal_method.invocations: isEmpty put toLowerCase getName getValue toLowerCase getName containsKey isBlank get format getName
focal_method.modifiers: public
focal_method.parameters: (final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)
focal_method.return: void
focal_method.signature: void validateAttributesAgainstBusinessObjectDataAttributeDefinitions(final List<Attribute> attributes,
          final Collection<BusinessObjectDataAttributeDefinitionEntity> businessObjectDataAttributeDefinitionEntities)