@Test
public void testValidateBusinessObjectDataSearchKeyTrimParameters() throws Exception
{

    // Create attribute value filters with filters that have extra whitespace around both attribute name and attribute value.
    List<AttributeValueFilter> attributeValueFilters = Arrays
        .asList(new AttributeValueFilter(addWhitespace(ATTRIBUTE_NAME), addWhitespace(ATTRIBUTE_VALUE)),
            new AttributeValueFilter(addWhitespace(ATTRIBUTE_NAME_2), addWhitespace(ATTRIBUTE_VALUE_2)));
    // Create a business object data search key that has extra whitespace around its string parameter values.
    BusinessObjectDataSearchKey businessObjectDataSearchKey =
        new BusinessObjectDataSearchKey(addWhitespace(BDEF_NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE),
            addWhitespace(FORMAT_FILE_TYPE_CODE), FORMAT_VERSION, NO_PARTITION_VALUE_FILTERS, NO_REGISTRATION_DATE_RANGE_FILTER, attributeValueFilters,
            FILTER_ON_LATEST_VALID_VERSION, FILTER_ON_RETENTION_EXPIRATION);
    // Call the method under test.
    businessObjectDataSearchHelper.validateBusinessObjectDataSearchKey(businessObjectDataSearchKey);
    // Validate the results.
    assertEquals(
        new BusinessObjectDataSearchKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, NO_PARTITION_VALUE_FILTERS,
            NO_REGISTRATION_DATE_RANGE_FILTER, Arrays.asList(new AttributeValueFilter(ATTRIBUTE_NAME, addWhitespace(ATTRIBUTE_VALUE)),
            new AttributeValueFilter(ATTRIBUTE_NAME_2, addWhitespace(ATTRIBUTE_VALUE_2))), FILTER_ON_LATEST_VALID_VERSION, FILTER_ON_RETENTION_EXPIRATION),
        businessObjectDataSearchKey);
}