@Test public void testSearchQuotes() { List<Quote> results = quoteService.findQuotesByCriteria(new SearchCriteria()); log.info("Found: " + results.size() + " quotes using blank search criteria."); for (Quote quote : results) { log.info("Quote: " + quote.toString()); } }
public List<Quote> findQuotesByCriteria(String criteria) { try { SearchCriteria searchCriteria = new SearchCriteria(); searchCriteria.setQuery(criteria); return findQuotesByCriteria(searchCriteria); } catch (EntityNotFoundException enfe) { log.info("Look ma, no results for: " + criteria); } return Collections.emptyList(); }
QuoteService { public List<Quote> findQuotesByCriteria(String criteria) { try { SearchCriteria searchCriteria = new SearchCriteria(); searchCriteria.setQuery(criteria); return findQuotesByCriteria(searchCriteria); } catch (EntityNotFoundException enfe) { log.info("Look ma, no results for: " + criteria); } return Collections.emptyList(); } }
QuoteService { public List<Quote> findQuotesByCriteria(String criteria) { try { SearchCriteria searchCriteria = new SearchCriteria(); searchCriteria.setQuery(criteria); return findQuotesByCriteria(searchCriteria); } catch (EntityNotFoundException enfe) { log.info("Look ma, no results for: " + criteria); } return Collections.emptyList(); }  }
QuoteService { public List<Quote> findQuotesByCriteria(String criteria) { try { SearchCriteria searchCriteria = new SearchCriteria(); searchCriteria.setQuery(criteria); return findQuotesByCriteria(searchCriteria); } catch (EntityNotFoundException enfe) { log.info("Look ma, no results for: " + criteria); } return Collections.emptyList(); }  void createOrUpdate(Quote quote); List<Quote> findQuotesByCriteria(String criteria); @SuppressWarnings("unchecked") List<Quote> findQuotesByCriteria(final SearchCriteria criteria); }
QuoteService { public List<Quote> findQuotesByCriteria(String criteria) { try { SearchCriteria searchCriteria = new SearchCriteria(); searchCriteria.setQuery(criteria); return findQuotesByCriteria(searchCriteria); } catch (EntityNotFoundException enfe) { log.info("Look ma, no results for: " + criteria); } return Collections.emptyList(); }  void createOrUpdate(Quote quote); List<Quote> findQuotesByCriteria(String criteria); @SuppressWarnings("unchecked") List<Quote> findQuotesByCriteria(final SearchCriteria criteria);  }