@Test public void shouldGetById() throws Exception { service.getById(3L); verify(repository).getDonorById(3L); }
public Donor getById(Long donorId){ return donorRepository.getDonorById(donorId); }
DonorService { public Donor getById(Long donorId){ return donorRepository.getDonorById(donorId); } }
DonorService { public Donor getById(Long donorId){ return donorRepository.getDonorById(donorId); } @Autowired  DonorService(DonorRepository donorRepository); }
DonorService { public Donor getById(Long donorId){ return donorRepository.getDonorById(donorId); } @Autowired  DonorService(DonorRepository donorRepository); void save(Donor donor); List<Donor> getAll(); List<Donor> getAllWithDetails(); void removeDonor(Long id); Donor getById(Long donorId); }
DonorService { public Donor getById(Long donorId){ return donorRepository.getDonorById(donorId); } @Autowired  DonorService(DonorRepository donorRepository); void save(Donor donor); List<Donor> getAll(); List<Donor> getAllWithDetails(); void removeDonor(Long id); Donor getById(Long donorId);  }