@Test public void findAllPersons() { repository.findAllPersons(); ArgumentCaptor<Sort> sortArgument = ArgumentCaptor.forClass(Sort.class); verify(personRepositoryMock, times(1)).findAll(sortArgument.capture()); Sort sort = sortArgument.getValue(); assertEquals(Sort.Direction.ASC, sort.getOrderFor(PROPERTY_LASTNAME).getDirection()); }
@Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } PaginatingPersonRepositoryImpl(); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } PaginatingPersonRepositoryImpl(); @Override List<Person> findAllPersons(); @Override long findPersonCount(String searchTerm); @Override List<Person> findPersonsForPage(String searchTerm, int page); @PostConstruct void init(); }
PaginatingPersonRepositoryImpl implements PaginatingPersonRepository { @Override public List<Person> findAllPersons() { LOGGER.debug("Finding all persons"); return personRepository.findAll(sortByLastNameAsc()); } PaginatingPersonRepositoryImpl(); @Override List<Person> findAllPersons(); @Override long findPersonCount(String searchTerm); @Override List<Person> findPersonsForPage(String searchTerm, int page); @PostConstruct void init();  }