SearchIndexStatusDaoHelper { public SearchIndexStatusEntity getSearchIndexStatusEntity(String code) throws ObjectNotFoundException { SearchIndexStatusEntity searchIndexStatusEntity = searchIndexStatusDao.getSearchIndexStatusByCode(code); if (searchIndexStatusEntity == null) { throw new ObjectNotFoundException(String.format("Search index status with code \"%s\" doesn't exist.", code)); } return searchIndexStatusEntity; }  SearchIndexStatusEntity getSearchIndexStatusEntity(String code);  }
@Test public void testGetSearchIndexStatusEntity() { SearchIndexStatusEntity searchIndexStatusEntity = searchIndexStatusDaoTestHelper.createSearchIndexStatusEntity(SEARCH_INDEX_STATUS); assertEquals(searchIndexStatusEntity, searchIndexStatusDaoHelper.getSearchIndexStatusEntity(SEARCH_INDEX_STATUS)); assertEquals(searchIndexStatusEntity, searchIndexStatusDaoHelper.getSearchIndexStatusEntity(SEARCH_INDEX_STATUS.toUpperCase())); assertEquals(searchIndexStatusEntity, searchIndexStatusDaoHelper.getSearchIndexStatusEntity(SEARCH_INDEX_STATUS.toLowerCase())); try { searchIndexStatusDaoHelper.getSearchIndexStatusEntity(I_DO_NOT_EXIST); fail(); } catch (ObjectNotFoundException e) { assertEquals(String.format("Search index status with code \"%s\" doesn't exist.", I_DO_NOT_EXIST), e.getMessage()); } }