@Test public void countSearchResults_ShouldReturnSearchResultCount() { when(indexServiceMock.countSearchResults(SEARCH_TERM)).thenReturn(RESULT_COUNT); long actual = service.countSearchResults(SEARCH_TERM); verify(indexServiceMock, times(1)).countSearchResults(SEARCH_TERM); verifyNoMoreInteractions(indexServiceMock); verifyZeroInteractions(repositoryMock); assertEquals(RESULT_COUNT, actual); }
@PreAuthorize("hasPermission('Todo', 'search')") @Override public long countSearchResults(String searchTerm) { LOGGER.debug("Getting search result count for search term: {}", searchTerm); return indexService.countSearchResults(searchTerm); }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public long countSearchResults(String searchTerm) { LOGGER.debug("Getting search result count for search term: {}", searchTerm); return indexService.countSearchResults(searchTerm); } }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public long countSearchResults(String searchTerm) { LOGGER.debug("Getting search result count for search term: {}", searchTerm); return indexService.countSearchResults(searchTerm); }  }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public long countSearchResults(String searchTerm) { LOGGER.debug("Getting search result count for search term: {}", searchTerm); return indexService.countSearchResults(searchTerm); }  @PreAuthorize("hasPermission('Todo', 'add')") @Transactional @Override Todo add(TodoDTO added); @PreAuthorize("hasPermission('Todo', 'search')") @Override long countSearchResults(String searchTerm); @PreAuthorize("hasPermission('Todo', 'delete')") @Transactional(rollbackFor = {TodoNotFoundException.class}) @Override Todo deleteById(Long id); @PreAuthorize("hasPermission('Todo', 'list')") @Transactional(readOnly = true) @Override List<Todo> findAll(); @PreAuthorize("hasPermission('Todo', 'find')") @Transactional(readOnly = true, rollbackFor = {TodoNotFoundException.class}) @Override Todo findById(Long id); @PreAuthorize("hasPermission('Todo', 'update')") @Transactional(rollbackFor = {TodoNotFoundException.class}) @Override Todo update(TodoDTO updated); @PreAuthorize("hasPermission('Todo', 'search')") @Override List<TodoDocument> search(String searchTerm, Pageable page); }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public long countSearchResults(String searchTerm) { LOGGER.debug("Getting search result count for search term: {}", searchTerm); return indexService.countSearchResults(searchTerm); }  @PreAuthorize("hasPermission('Todo', 'add')") @Transactional @Override Todo add(TodoDTO added); @PreAuthorize("hasPermission('Todo', 'search')") @Override long countSearchResults(String searchTerm); @PreAuthorize("hasPermission('Todo', 'delete')") @Transactional(rollbackFor = {TodoNotFoundException.class}) @Override Todo deleteById(Long id); @PreAuthorize("hasPermission('Todo', 'list')") @Transactional(readOnly = true) @Override List<Todo> findAll(); @PreAuthorize("hasPermission('Todo', 'find')") @Transactional(readOnly = true, rollbackFor = {TodoNotFoundException.class}) @Override Todo findById(Long id); @PreAuthorize("hasPermission('Todo', 'update')") @Transactional(rollbackFor = {TodoNotFoundException.class}) @Override Todo update(TodoDTO updated); @PreAuthorize("hasPermission('Todo', 'search')") @Override List<TodoDocument> search(String searchTerm, Pageable page);  }