@Test public void findById() { Person person = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME, LAST_NAME); when(personRepositoryMock.findOne(PERSON_ID)).thenReturn(person); Person returned = personService.findById(PERSON_ID); verify(personRepositoryMock, times(1)).findOne(PERSON_ID); verifyNoMoreInteractions(personRepositoryMock); assertEquals(person, returned); }
@Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); } }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); }  }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); }  @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String searchTerm); @Transactional(rollbackFor = PersonNotFoundException.class) @Override Person delete(Long personId); @Transactional(readOnly = true) @Override List<Person> findAll(); @Transactional(readOnly = true) @Override Person findById(Long id); @Transactional(readOnly = true) @Override List<Person> search(String searchTerm, int pageIndex); @Transactional(rollbackFor = PersonNotFoundException.class) @Override Person update(PersonDTO updated); }
RepositoryPersonService implements PersonService { @Transactional(readOnly = true) @Override public Person findById(Long id) { LOGGER.debug("Finding person by id: " + id); return personRepository.findOne(id); }  @Transactional @Override Person create(PersonDTO created); @Transactional @Override long count(String searchTerm); @Transactional(rollbackFor = PersonNotFoundException.class) @Override Person delete(Long personId); @Transactional(readOnly = true) @Override List<Person> findAll(); @Transactional(readOnly = true) @Override Person findById(Long id); @Transactional(readOnly = true) @Override List<Person> search(String searchTerm, int pageIndex); @Transactional(rollbackFor = PersonNotFoundException.class) @Override Person update(PersonDTO updated);  }