@Test public void search_ShouldReturnTodoDocuments() { List<TodoDocument> expected = new ArrayList<TodoDocument>(); when(indexServiceMock.search(SEARCH_TERM)).thenReturn(expected); List<TodoDocument> actual = service.search(SEARCH_TERM); verify(indexServiceMock, times(1)).search(SEARCH_TERM); verifyNoMoreInteractions(indexServiceMock); verifyZeroInteractions(repositoryMock); assertEquals(expected, actual); }
@PreAuthorize("hasPermission('Todo', 'search')") @Override public List<TodoDocument> search(String searchTerm) { LOGGER.debug("Search todo entries with search term: {}", searchTerm); return indexService.search(searchTerm); }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public List<TodoDocument> search(String searchTerm) { LOGGER.debug("Search todo entries with search term: {}", searchTerm); return indexService.search(searchTerm); } }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public List<TodoDocument> search(String searchTerm) { LOGGER.debug("Search todo entries with search term: {}", searchTerm); return indexService.search(searchTerm); }  }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public List<TodoDocument> search(String searchTerm) { LOGGER.debug("Search todo entries with search term: {}", searchTerm); return indexService.search(searchTerm); }  @PreAuthorize("hasPermission('Todo', 'add')") @Transactional @Override Todo add(TodoDTO added); @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); }
RepositoryTodoService implements TodoService { @PreAuthorize("hasPermission('Todo', 'search')") @Override public List<TodoDocument> search(String searchTerm) { LOGGER.debug("Search todo entries with search term: {}", searchTerm); return indexService.search(searchTerm); }  @PreAuthorize("hasPermission('Todo', 'add')") @Transactional @Override Todo add(TodoDTO added); @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);  }