@Test public void shouldGetAllFacilitiesByModifiedDate() throws Exception { List<Facility> expectedFacilities = new ArrayList<>(); Date dateModified = new Date(); when(mapper.getAllByProgramSupportedModifiedDate(dateModified)).thenReturn(expectedFacilities); List<Facility> facilities = repository.getAllByProgramSupportedModifiedDate(dateModified); assertThat(facilities, is(expectedFacilities)); verify(mapper).getAllByProgramSupportedModifiedDate(dateModified); }
public List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified) { return mapper.getAllByProgramSupportedModifiedDate(dateModified); }
FacilityRepository { public List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified) { return mapper.getAllByProgramSupportedModifiedDate(dateModified); } }
FacilityRepository { public List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified) { return mapper.getAllByProgramSupportedModifiedDate(dateModified); } @Autowired  FacilityRepository(FacilityMapper facilityMapper,
                            FacilityTypeRepository facilityTypeRepository,
                            GeographicZoneRepository geographicZoneRepository,
                            FacilityOperatorRepository facilityOperatorRepository); }
FacilityRepository { public List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified) { return mapper.getAllByProgramSupportedModifiedDate(dateModified); } @Autowired  FacilityRepository(FacilityMapper facilityMapper,
                            FacilityTypeRepository facilityTypeRepository,
                            GeographicZoneRepository geographicZoneRepository,
                            FacilityOperatorRepository facilityOperatorRepository); List<Facility> getMailingLabels(); void save(Facility facility); Facility getHomeFacility(Long userId); Facility getById(Long id); Facility updateEnabledAndActiveFor(Facility facility); List<Facility> getFacilitiesBy(Long programId, List<RequisitionGroup> requisitionGroups); List<Facility> getAllInRequisitionGroups(List<RequisitionGroup> requisitionGroups); List<Facility> getAllByFacilityTypeCode(String typeCode); Long getIdForCode(String code); Facility getHomeFacilityForRights(Long userId, String... rightNames); Facility getByCode(String code); List<Facility> getAllInDeliveryZoneFor(Long deliveryZoneId, Long programId); List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified); List<Facility> getEnabledWarehouses(); List<Facility> getChildFacilities(Facility facility); void updateVirtualFacilities(Facility parentFacility); List<Facility> getAllByRequisitionGroupMemberModifiedDate(Date modifiedDate); List<Facility> getAllParentsByModifiedDate(Date modifiedDate); Integer getFacilitiesCountBy(String searchParam, Long facilityTypeId, Long geoZoneId, Boolean virtualFacility, Boolean enabled); List<Facility> searchFacilitiesBy(String searchParam, Long facilityTypeId, Long geoZoneId, Boolean virtualFacility, Boolean enabled); Integer getTotalSearchResultCount(String searchParam); Integer getTotalSearchResultCountByGeographicZone(String searchParam); List<Facility> searchBy(String searchParam, String columnName, Pagination pagination); List<FacilityContact> getEmailContacts(Long facilityId); List<FacilityContact> getSmsContacts(Long facilityId); List<FacilitySupervisor> getFacilitySupervisors(Long facilityId); List<Facility> getAllForGeographicZone(Long geographicZoneId); List<Facility> getFacilityByTypeAndRequisitionGroupId(Long facilityTypeId, Long rgroupId); List<FacilityGeoTreeDto> getGeoRegionFacilityTree(Long userId); List<FacilityGeoTreeDto> getGeoDistrictFacility(Long userId); List<FacilityGeoTreeDto> getGeoFlatFacilityTree(Long userId); }
FacilityRepository { public List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified) { return mapper.getAllByProgramSupportedModifiedDate(dateModified); } @Autowired  FacilityRepository(FacilityMapper facilityMapper,
                            FacilityTypeRepository facilityTypeRepository,
                            GeographicZoneRepository geographicZoneRepository,
                            FacilityOperatorRepository facilityOperatorRepository); List<Facility> getMailingLabels(); void save(Facility facility); Facility getHomeFacility(Long userId); Facility getById(Long id); Facility updateEnabledAndActiveFor(Facility facility); List<Facility> getFacilitiesBy(Long programId, List<RequisitionGroup> requisitionGroups); List<Facility> getAllInRequisitionGroups(List<RequisitionGroup> requisitionGroups); List<Facility> getAllByFacilityTypeCode(String typeCode); Long getIdForCode(String code); Facility getHomeFacilityForRights(Long userId, String... rightNames); Facility getByCode(String code); List<Facility> getAllInDeliveryZoneFor(Long deliveryZoneId, Long programId); List<Facility> getAllByProgramSupportedModifiedDate(Date dateModified); List<Facility> getEnabledWarehouses(); List<Facility> getChildFacilities(Facility facility); void updateVirtualFacilities(Facility parentFacility); List<Facility> getAllByRequisitionGroupMemberModifiedDate(Date modifiedDate); List<Facility> getAllParentsByModifiedDate(Date modifiedDate); Integer getFacilitiesCountBy(String searchParam, Long facilityTypeId, Long geoZoneId, Boolean virtualFacility, Boolean enabled); List<Facility> searchFacilitiesBy(String searchParam, Long facilityTypeId, Long geoZoneId, Boolean virtualFacility, Boolean enabled); Integer getTotalSearchResultCount(String searchParam); Integer getTotalSearchResultCountByGeographicZone(String searchParam); List<Facility> searchBy(String searchParam, String columnName, Pagination pagination); List<FacilityContact> getEmailContacts(Long facilityId); List<FacilityContact> getSmsContacts(Long facilityId); List<FacilitySupervisor> getFacilitySupervisors(Long facilityId); List<Facility> getAllForGeographicZone(Long geographicZoneId); List<Facility> getFacilityByTypeAndRequisitionGroupId(Long facilityTypeId, Long rgroupId); List<FacilityGeoTreeDto> getGeoRegionFacilityTree(Long userId); List<FacilityGeoTreeDto> getGeoDistrictFacility(Long userId); List<FacilityGeoTreeDto> getGeoFlatFacilityTree(Long userId);  }