SearchIndexDaoHelper { public SearchIndexEntity getSearchIndexEntity(SearchIndexKey searchIndexKey) throws ObjectNotFoundException { SearchIndexEntity searchIndexEntity = searchIndexDao.getSearchIndexByKey(searchIndexKey); if (searchIndexEntity == null) { throw new ObjectNotFoundException(String.format("Search index with name \"%s\" doesn't exist.", searchIndexKey.getSearchIndexName())); } return searchIndexEntity; }  SearchIndexEntity getSearchIndexEntity(SearchIndexKey searchIndexKey); void updateSearchIndexStatus(SearchIndexKey searchIndexKey, String searchIndexStatus); void activateSearchIndex(SearchIndexEntity currentSearchIndexEntity); String getActiveSearchIndex(String indexType);  }
@Test public void testGetSearchIndexEntity() { SearchIndexEntity searchIndexEntity = searchIndexDaoTestHelper.createSearchIndexEntity(SEARCH_INDEX_NAME, SEARCH_INDEX_TYPE, SEARCH_INDEX_STATUS); assertEquals(searchIndexEntity, searchIndexDaoHelper.getSearchIndexEntity(new SearchIndexKey(SEARCH_INDEX_NAME))); 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()); } }