@Test public void search_ShouldReturnDocuments() { List<TodoDocument> expected = new ArrayList<TodoDocument>(); when(repositoryMock.search(eq(SEARCH_TERM), any(Pageable.class))).thenReturn(expected); Pageable page = new PageRequest(0, 10); List<TodoDocument> actual = service.search(SEARCH_TERM, page); verify(repositoryMock, times(1)).search(SEARCH_TERM, page); verifyNoMoreInteractions(repositoryMock); assertEquals(expected, actual); }
@Override public List<TodoDocument> search(String searchTerm, Pageable page) { LOGGER.debug("Searching documents with search term: {} and page: {}", searchTerm, page); return repository.search(searchTerm, page); }
RepositoryTodoIndexService implements TodoIndexService { @Override public List<TodoDocument> search(String searchTerm, Pageable page) { LOGGER.debug("Searching documents with search term: {} and page: {}", searchTerm, page); return repository.search(searchTerm, page); } }
RepositoryTodoIndexService implements TodoIndexService { @Override public List<TodoDocument> search(String searchTerm, Pageable page) { LOGGER.debug("Searching documents with search term: {} and page: {}", searchTerm, page); return repository.search(searchTerm, page); }  }
RepositoryTodoIndexService implements TodoIndexService { @Override public List<TodoDocument> search(String searchTerm, Pageable page) { LOGGER.debug("Searching documents with search term: {} and page: {}", searchTerm, page); return repository.search(searchTerm, page); }  @Transactional @Override void addToIndex(Todo todoEntry); @Override long countSearchResults(String searchTerm); @Transactional @Override void deleteFromIndex(Long id); @Override List<TodoDocument> search(String searchTerm, Pageable page); @Transactional @Override void update(Todo todoEntry); }
RepositoryTodoIndexService implements TodoIndexService { @Override public List<TodoDocument> search(String searchTerm, Pageable page) { LOGGER.debug("Searching documents with search term: {} and page: {}", searchTerm, page); return repository.search(searchTerm, page); }  @Transactional @Override void addToIndex(Todo todoEntry); @Override long countSearchResults(String searchTerm); @Transactional @Override void deleteFromIndex(Long id); @Override List<TodoDocument> search(String searchTerm, Pageable page); @Transactional @Override void update(Todo todoEntry);  }