@Test public void shouldGetChildFacilities() throws Exception { Facility facility = new Facility(1L); List<Facility> expectedFacilities = asList(new Facility(5L)); when(mapper.getChildFacilities(facility)).thenReturn(expectedFacilities); List<Facility> childFacilities = repository.getChildFacilities(facility); verify(mapper).getChildFacilities(facility); assertThat(childFacilities, is(expectedFacilities)); }
public List<Facility> getChildFacilities(Facility facility) { return mapper.getChildFacilities(facility); }
FacilityRepository { public List<Facility> getChildFacilities(Facility facility) { return mapper.getChildFacilities(facility); } }
FacilityRepository { public List<Facility> getChildFacilities(Facility facility) { return mapper.getChildFacilities(facility); } @Autowired  FacilityRepository(FacilityMapper facilityMapper,
                            FacilityTypeRepository facilityTypeRepository,
                            GeographicZoneRepository geographicZoneRepository,
                            FacilityOperatorRepository facilityOperatorRepository); }
FacilityRepository { public List<Facility> getChildFacilities(Facility facility) { return mapper.getChildFacilities(facility); } @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> getChildFacilities(Facility facility) { return mapper.getChildFacilities(facility); } @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);  }