@Test public void shouldSaveFacilityVisitWithVisitDetails() { FacilityVisit facilityVisit = spy(new FacilityVisit()); doNothing().when(facilityVisit).setApplicableVisitInfo(); when(facilityVisitRepository.save(facilityVisit)).thenReturn(facilityVisit); FacilityVisit savedVisit = facilityVisitService.save(facilityVisit); assertThat(savedVisit, is(facilityVisit)); verify(facilityVisitRepository).save(facilityVisit); verify(facilityVisit).setApplicableVisitInfo(); }
public FacilityVisit save(FacilityVisit facilityVisit) { facilityVisit.setApplicableVisitInfo(); return repository.save(facilityVisit); }
FacilityVisitService { public FacilityVisit save(FacilityVisit facilityVisit) { facilityVisit.setApplicableVisitInfo(); return repository.save(facilityVisit); } }
FacilityVisitService { public FacilityVisit save(FacilityVisit facilityVisit) { facilityVisit.setApplicableVisitInfo(); return repository.save(facilityVisit); }  }
FacilityVisitService { public FacilityVisit save(FacilityVisit facilityVisit) { facilityVisit.setApplicableVisitInfo(); return repository.save(facilityVisit); }  FacilityVisit save(FacilityVisit facilityVisit); FacilityVisit setSynced(FacilityVisit facilityVisit); FacilityVisit getById(Long facilityVisitId); FacilityVisit getBy(Long facilityId, Long distributionId); List<FacilityVisit> getUnSyncedFacilities(Long distributionId); Integer getUnsyncedFacilityCountForDistribution(Long distributionId); }
FacilityVisitService { public FacilityVisit save(FacilityVisit facilityVisit) { facilityVisit.setApplicableVisitInfo(); return repository.save(facilityVisit); }  FacilityVisit save(FacilityVisit facilityVisit); FacilityVisit setSynced(FacilityVisit facilityVisit); FacilityVisit getById(Long facilityVisitId); FacilityVisit getBy(Long facilityId, Long distributionId); List<FacilityVisit> getUnSyncedFacilities(Long distributionId); Integer getUnsyncedFacilityCountForDistribution(Long distributionId);  }