@Test
public void testGetSearchIndexEntity()
{

    // Create and persist database entities required for testing.
    SearchIndexEntity searchIndexEntity = searchIndexDaoTestHelper.createSearchIndexEntity(SEARCH_INDEX_NAME, SEARCH_INDEX_TYPE, SEARCH_INDEX_STATUS);
    // Retrieve the search index entity.
    assertEquals(searchIndexEntity, searchIndexDaoHelper.getSearchIndexEntity(new SearchIndexKey(SEARCH_INDEX_NAME)));
    // Try to retrieve a non-existing search index.
    try
    {
        searchIndexDaoHelper.getSearchIndexEntity(new SearchIndexKey(I_DO_NOT_EXIST));
        fail();
    }
    catch (ObjectNotFoundException e)
    {
        assertEquals(String.format("Search index with name \"%s\" doesn't exist.", I_DO_NOT_EXIST), e.getMessage());
    }
}