use of org.finra.herd.model.api.xml.AttributeValueListKey in project herd by FINRAOS.
the class AllowedAttributeValueServiceTest method testDeleteAllowedAttributeValuesMissingAllowedAttributeValue.
@Test
public void testDeleteAllowedAttributeValuesMissingAllowedAttributeValue() {
// Create attribute value list key.
AttributeValueListKey attributeValueListKey = new AttributeValueListKey(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME);
// Create a delete request without allowed attribute value.
AllowedAttributeValuesDeleteRequest request = new AllowedAttributeValuesDeleteRequest(attributeValueListKey, NO_ALLOWED_ATTRIBUTE_VALUES);
// Try to call method under test.
try {
allowedAttributeValueService.deleteAllowedAttributeValues(request);
fail();
} catch (IllegalArgumentException e) {
assertEquals("At least one allowed attribute value must be specified.", e.getMessage());
}
// Verify the external calls.
verify(attributeValueListHelper).validateAttributeValueListKey(attributeValueListKey);
verifyNoMoreInteractionsHelper();
}
use of org.finra.herd.model.api.xml.AttributeValueListKey in project herd by FINRAOS.
the class BusinessObjectFormatServiceTest method createGlobalAttributeDefinitionEntityWithAllowedAttributeValues.
private GlobalAttributeDefinitionEntity createGlobalAttributeDefinitionEntityWithAllowedAttributeValues() {
// Create attribute value list key.
AttributeValueListKey attributeValueListKey = new AttributeValueListKey(NAMESPACE_CODE, ATTRIBUTE_VALUE_LIST_NAME);
List<String> allowedAttributeValueList = Arrays.asList(ALLOWED_ATTRIBUTE_VALUE, ALLOWED_ATTRIBUTE_VALUE_2);
// Create and persist a attribute value list key entity.
AttributeValueListEntity attributeValueListEntity = attributeValueListDaoTestHelper.createAttributeValueListEntity(NAMESPACE_CODE, ATTRIBUTE_VALUE_LIST_NAME);
// Create and persist a list of allowed attribute values.
List<AllowedAttributeValueEntity> allowedAttributeValueEntities = allowedAttributeValueDaoTestHelper.createAllowedAttributeValueEntities(attributeValueListKey, allowedAttributeValueList);
attributeValueListEntity.getAllowedAttributeValues().addAll(allowedAttributeValueEntities);
GlobalAttributeDefinitionEntity globalAttributeDefinitionEntity = globalAttributeDefinitionDaoTestHelper.createGlobalAttributeDefinitionEntity(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME);
globalAttributeDefinitionEntity.setAttributeValueList(attributeValueListEntity);
return globalAttributeDefinitionEntity;
}
Aggregations