SearchIndexDaoHelper { public void updateSearchIndexStatus(SearchIndexKey searchIndexKey, String searchIndexStatus) throws ObjectNotFoundException { SearchIndexEntity searchIndexEntity = getSearchIndexEntity(searchIndexKey); SearchIndexStatusEntity searchIndexStatusEntity = searchIndexStatusDaoHelper.getSearchIndexStatusEntity(searchIndexStatus); searchIndexEntity.setStatus(searchIndexStatusEntity); searchIndexDao.saveAndRefresh(searchIndexEntity); }  SearchIndexEntity getSearchIndexEntity(SearchIndexKey searchIndexKey); void updateSearchIndexStatus(SearchIndexKey searchIndexKey, String searchIndexStatus); void activateSearchIndex(SearchIndexEntity currentSearchIndexEntity); String getActiveSearchIndex(String indexType);  }
@Test public void testUpdateSearchIndexStatus() { SearchIndexEntity searchIndexEntity = searchIndexDaoTestHelper.createSearchIndexEntity(SEARCH_INDEX_NAME, SEARCH_INDEX_TYPE, SEARCH_INDEX_STATUS); searchIndexStatusDaoTestHelper.createSearchIndexStatusEntity(SEARCH_INDEX_STATUS_2); searchIndexDaoHelper.updateSearchIndexStatus(new SearchIndexKey(SEARCH_INDEX_NAME), SEARCH_INDEX_STATUS_2); assertEquals(SEARCH_INDEX_STATUS_2, searchIndexEntity.getStatus().getCode()); }