@Test public void shouldGetAllRequisitionGroupMembersByFacilityId() throws Exception { Long facilityId = 4L; List<RequisitionGroupMember> expectedMembers = asList(new RequisitionGroupMember()); when(requisitionGroupMemberRepository.getAllRequisitionGroupMembersByFacility(facilityId)).thenReturn(expectedMembers); List<RequisitionGroupMember> actualMembers = service.getAllRequisitionGroupMembersByFacility(facilityId); verify(requisitionGroupMemberRepository).getAllRequisitionGroupMembersByFacility(facilityId); assertThat(actualMembers, is(expectedMembers)); }
public List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId) { return requisitionGroupMemberRepository.getAllRequisitionGroupMembersByFacility(facilityId); }
RequisitionGroupMemberService { public List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId) { return requisitionGroupMemberRepository.getAllRequisitionGroupMembersByFacility(facilityId); } }
RequisitionGroupMemberService { public List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId) { return requisitionGroupMemberRepository.getAllRequisitionGroupMembersByFacility(facilityId); } @Autowired  RequisitionGroupMemberService(RequisitionGroupMemberRepository requisitionGroupMemberRepository,
                                       FacilityRepository facilityRepository, RequisitionGroupRepository requisitionGroupRepository,
                                       RequisitionGroupProgramScheduleRepository requisitionGroupProgramScheduleRepository,
                                       ProgramRepository programRepository); }
RequisitionGroupMemberService { public List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId) { return requisitionGroupMemberRepository.getAllRequisitionGroupMembersByFacility(facilityId); } @Autowired  RequisitionGroupMemberService(RequisitionGroupMemberRepository requisitionGroupMemberRepository,
                                       FacilityRepository facilityRepository, RequisitionGroupRepository requisitionGroupRepository,
                                       RequisitionGroupProgramScheduleRepository requisitionGroupProgramScheduleRepository,
                                       ProgramRepository programRepository); void save(RequisitionGroupMember requisitionGroupMember); void updateMembersForVirtualFacilities(Facility parentFacility); RequisitionGroupMember getExisting(RequisitionGroupMember record); void removeRequisitionGroupMember(RequisitionGroup requisitionGroup, Facility facility); List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId); void deleteMembersFor(Facility facility); List<RequisitionGroupMember> getMembersBy(Long requisitionGroupId); void deleteMembersForGroup(Long requisitionGroupId); void insert(RequisitionGroupMember member); }
RequisitionGroupMemberService { public List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId) { return requisitionGroupMemberRepository.getAllRequisitionGroupMembersByFacility(facilityId); } @Autowired  RequisitionGroupMemberService(RequisitionGroupMemberRepository requisitionGroupMemberRepository,
                                       FacilityRepository facilityRepository, RequisitionGroupRepository requisitionGroupRepository,
                                       RequisitionGroupProgramScheduleRepository requisitionGroupProgramScheduleRepository,
                                       ProgramRepository programRepository); void save(RequisitionGroupMember requisitionGroupMember); void updateMembersForVirtualFacilities(Facility parentFacility); RequisitionGroupMember getExisting(RequisitionGroupMember record); void removeRequisitionGroupMember(RequisitionGroup requisitionGroup, Facility facility); List<RequisitionGroupMember> getAllRequisitionGroupMembersByFacility(Long facilityId); void deleteMembersFor(Facility facility); List<RequisitionGroupMember> getMembersBy(Long requisitionGroupId); void deleteMembersForGroup(Long requisitionGroupId); void insert(RequisitionGroupMember member);  }