### Question:
ApplicationPageDataStore extends CommonDatastore<ApplicationPageItem, ApplicationPage> implements DatastoreHasAdd<ApplicationPageItem>,
DatastoreHasGet<ApplicationPageItem>, DatastoreHasSearch<ApplicationPageItem>, DatastoreHasDelete { @Override public ItemSearchResult<ApplicationPageItem> search(final int page, final int resultsByPage, final String search, final String orders, final Map<String, String> filters) { final SearchOptionsCreator creator = makeSearchOptionCreator(page, resultsByPage, search, orders, filters); try { final SearchResult<ApplicationPage> searchResult = runSearch(creator); final List<ApplicationPageItem> appPageItems = convertEngineToConsoleItemsList(searchResult.getResult()); return new ItemSearchResult<ApplicationPageItem>(page, resultsByPage, searchResult.getCount(), appPageItems); } catch (final SearchException e) { throw new APIException(e); } } ApplicationPageDataStore(final APISession engineSession, final ApplicationAPI applicationAPI, final PageAPI pageAPI,
            final ApplicationPageItemConverter converter); @Override ApplicationPageItem add(final ApplicationPageItem item); @Override ApplicationPageItem get(final APIID id); @Override void delete(final List<APIID> ids); @Override ItemSearchResult<ApplicationPageItem> search(final int page, final int resultsByPage, final String search, final String orders,
            final Map<String, String> filters);  }### Answer:
@Test(expected = APIException.class) public void should_throw_APIException_when_engine_throws_SearchException_on_search() throws Exception { final String orders = ApplicationPageItem.ATTRIBUTE_TOKEN + " DESC"; given(applicationAPI.searchApplicationPages(any(SearchOptions.class))).willThrow(new SearchException(null)); dataStore.search(0, 1, null, orders, Collections.<String, String> emptyMap()); }