@Test
public void testGetBusinessObjectDefinitionDescriptionSuggestionsByBusinessObjectDefinitionAndStatus()
{

    // Create the relative entities.
    NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
    BusinessObjectDefinitionEntity businessObjectDefinitionEntity = businessObjectDefinitionDaoTestHelper
        .createBusinessObjectDefinitionEntity(namespaceEntity.getCode(), BDEF_NAME, DATA_PROVIDER_NAME, BDEF_DESCRIPTION);
    BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(NAMESPACE, BDEF_NAME);
    BusinessObjectDefinitionDescriptionSuggestionStatusEntity businessObjectDefinitionDescriptionSuggestionStatusEntity =
        businessObjectDefinitionDescriptionSuggestionStatusDaoTestHelper
            .createBusinessObjectDefinitionDescriptionSuggestionStatusEntity(BDEF_DESCRIPTION_SUGGESTION_STATUS);
    // Create new business object definition description suggestion entities.
    BusinessObjectDefinitionDescriptionSuggestionEntity businessObjectDefinitionDescriptionSuggestionEntity =
        new BusinessObjectDefinitionDescriptionSuggestionEntity();
    businessObjectDefinitionDescriptionSuggestionEntity.setBusinessObjectDefinition(businessObjectDefinitionEntity);
    businessObjectDefinitionDescriptionSuggestionEntity.setDescriptionSuggestion(DESCRIPTION_SUGGESTION);
    businessObjectDefinitionDescriptionSuggestionEntity.setUserId(USER_ID);
    businessObjectDefinitionDescriptionSuggestionEntity.setStatus(businessObjectDefinitionDescriptionSuggestionStatusEntity);
    BusinessObjectDefinitionDescriptionSuggestionEntity businessObjectDefinitionDescriptionSuggestionEntity2 =
        new BusinessObjectDefinitionDescriptionSuggestionEntity();
    businessObjectDefinitionDescriptionSuggestionEntity2.setBusinessObjectDefinition(businessObjectDefinitionEntity);
    businessObjectDefinitionDescriptionSuggestionEntity2.setDescriptionSuggestion(DESCRIPTION_SUGGESTION_2);
    businessObjectDefinitionDescriptionSuggestionEntity2.setUserId(USER_ID_2);
    businessObjectDefinitionDescriptionSuggestionEntity2.setStatus(businessObjectDefinitionDescriptionSuggestionStatusEntity);
    List<BusinessObjectDefinitionDescriptionSuggestionEntity> businessObjectDefinitionDescriptionSuggestionEntities =
        Lists.newArrayList(businessObjectDefinitionDescriptionSuggestionEntity, businessObjectDefinitionDescriptionSuggestionEntity2);
    // Setup mock interactions.
    when(businessObjectDefinitionDao.getBusinessObjectDefinitionByKey(businessObjectDefinitionKey)).thenReturn(businessObjectDefinitionEntity);
    when(businessObjectDefinitionDescriptionSuggestionStatusDao
        .getBusinessObjectDefinitionDescriptionSuggestionStatusByCode(BDEF_DESCRIPTION_SUGGESTION_STATUS))
        .thenReturn(businessObjectDefinitionDescriptionSuggestionStatusEntity);
    when(businessObjectDefinitionDescriptionSuggestionDao
        .getBusinessObjectDefinitionDescriptionSuggestionsByBusinessObjectDefinitionAndStatus(businessObjectDefinitionEntity,
            businessObjectDefinitionDescriptionSuggestionStatusEntity)).thenReturn(businessObjectDefinitionDescriptionSuggestionEntities);
    // Call method under test.
    List<BusinessObjectDefinitionDescriptionSuggestionEntity> result = businessObjectDefinitionDescriptionSuggestionDaoHelper
        .getBusinessObjectDefinitionDescriptionSuggestionsByBusinessObjectDefinitionAndStatus(businessObjectDefinitionKey,
            BDEF_DESCRIPTION_SUGGESTION_STATUS);
    // Validate results.
    assertThat("Result size does not equal businessObjectDefinitionDescriptionSuggestionEntities.", result.size(),
        is(equalTo(businessObjectDefinitionDescriptionSuggestionEntities.size())));
    for (int i = 0; i < result.size(); i++)
    {
        assertThat("Result is not equal businessObjectDefinitionDescriptionSuggestionEntity.", result.get(i),
            is(equalTo(businessObjectDefinitionDescriptionSuggestionEntities.get(i))));
    }
    // Verify mocks interactions.
    verify(businessObjectDefinitionDao).getBusinessObjectDefinitionByKey(businessObjectDefinitionKey);
    verify(businessObjectDefinitionDescriptionSuggestionStatusDao)
        .getBusinessObjectDefinitionDescriptionSuggestionStatusByCode(BDEF_DESCRIPTION_SUGGESTION_STATUS);
    verify(businessObjectDefinitionDescriptionSuggestionDao)
        .getBusinessObjectDefinitionDescriptionSuggestionsByBusinessObjectDefinitionAndStatus(businessObjectDefinitionEntity,
            businessObjectDefinitionDescriptionSuggestionStatusEntity);
    verifyNoMoreInteractions(businessObjectDefinitionDao, businessObjectDefinitionDescriptionSuggestionDao,
        businessObjectDefinitionDescriptionSuggestionStatusDao);
}