@Test public void testGetResults() { OmniSearchHandler productsOmniSearchHandler = Mockito.mock(OmniSearchHandler.class); Whitebox.setInternalState(suggestionHandler, "productsOmniSearchHandler", productsOmniSearchHandler); Map<String, Object> params = Collections.singletonMap("fulltext", "whatever"); suggestionHandler.getResults(resolver, params, 20, 10); Assert.assertEquals("product", suggestionHandler.getID()); Mockito.verify(productsOmniSearchHandler).getResults(resolver, params, 20, 10); }
@Override public SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset) { return productsOmniSearchHandler.getResults(resolver, predicateParameters, limit, offset); }
ProductsSuggestionOmniSearchHandler extends AbstractOmniSearchHandler { @Override public SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset) { return productsOmniSearchHandler.getResults(resolver, predicateParameters, limit, offset); } }
ProductsSuggestionOmniSearchHandler extends AbstractOmniSearchHandler { @Override public SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset) { return productsOmniSearchHandler.getResults(resolver, predicateParameters, limit, offset); }  }
ProductsSuggestionOmniSearchHandler extends AbstractOmniSearchHandler { @Override public SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset) { return productsOmniSearchHandler.getResults(resolver, predicateParameters, limit, offset); }  @Override String getID(); @Override void onEvent(EventIterator eventIterator); @Override SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset); @Override javax.jcr.query.Query getSuggestionQuery(ResourceResolver resolver, String searchTerm); }
ProductsSuggestionOmniSearchHandler extends AbstractOmniSearchHandler { @Override public SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset) { return productsOmniSearchHandler.getResults(resolver, predicateParameters, limit, offset); }  @Override String getID(); @Override void onEvent(EventIterator eventIterator); @Override SearchResult getResults(ResourceResolver resolver, Map<String, Object> predicateParameters, long limit, long offset); @Override javax.jcr.query.Query getSuggestionQuery(ResourceResolver resolver, String searchTerm);  }