DummySearchService implements SearchService { @Override public ListenableFuture<SearchResponse> basicSearch(BasicSearchRequest request) { SearchResponse response = new SearchResponse(); response.setResultList(Arrays.asList( "result 1", "result 2" )); return Futures.immediateFuture(response); }  @Override ListenableFuture<SearchResponse> basicSearch(BasicSearchRequest request); @Override ListenableFuture<SearchResponse> extendedSearch(ExtendedSearchRequest request);  }
@Test public void testBasicSearch() throws Exception { ListenableFuture<SearchResponse> result = service.basicSearch(new BasicSearchRequest()); Assert.assertEquals(Arrays.asList("result 1", "result 2"), result.get().getResultList()); }