@Test public void shouldUpdateRequisitionGroupProgramSchedule() throws Exception { Program program = new Program(); program.setPush(false); Long programId = 1L; when(requisitionGroupMapper.getIdForCode(requisitionGroupProgramSchedule.getRequisitionGroup().getCode())).thenReturn(1L); when(programRepository.getIdByCode(requisitionGroupProgramSchedule.getProgram().getCode())).thenReturn(programId); when(programRepository.getById(programId)).thenReturn(program); when(processingScheduleMapper.getIdForCode(requisitionGroupProgramSchedule.getProcessingSchedule().getCode())).thenReturn(1L); when(facilityMapper.getIdForCode(dropOffFacility.getCode())).thenReturn(1L); requisitionGroupProgramSchedule.setDropOffFacility(dropOffFacility); repository.update(requisitionGroupProgramSchedule); verify(requisitionGroupProgramScheduleMapper).update(requisitionGroupProgramSchedule); }
public void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule) { populateIdsForRequisitionProgramScheduleEntities(requisitionGroupProgramSchedule); validateRequisitionGroupSchedule(requisitionGroupProgramSchedule); validateProgramType(requisitionGroupProgramSchedule); mapper.update(requisitionGroupProgramSchedule); }
RequisitionGroupProgramScheduleRepository { public void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule) { populateIdsForRequisitionProgramScheduleEntities(requisitionGroupProgramSchedule); validateRequisitionGroupSchedule(requisitionGroupProgramSchedule); validateProgramType(requisitionGroupProgramSchedule); mapper.update(requisitionGroupProgramSchedule); } }
RequisitionGroupProgramScheduleRepository { public void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule) { populateIdsForRequisitionProgramScheduleEntities(requisitionGroupProgramSchedule); validateRequisitionGroupSchedule(requisitionGroupProgramSchedule); validateProgramType(requisitionGroupProgramSchedule); mapper.update(requisitionGroupProgramSchedule); } @Autowired  RequisitionGroupProgramScheduleRepository(
    RequisitionGroupProgramScheduleMapper requisitionGroupProgramScheduleMapper,
    RequisitionGroupMapper requisitionGroupMapper,
    ProgramRepository programRepository,
    ProcessingScheduleMapper processingScheduleMapper,
    FacilityMapper facilityMapper); }
RequisitionGroupProgramScheduleRepository { public void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule) { populateIdsForRequisitionProgramScheduleEntities(requisitionGroupProgramSchedule); validateRequisitionGroupSchedule(requisitionGroupProgramSchedule); validateProgramType(requisitionGroupProgramSchedule); mapper.update(requisitionGroupProgramSchedule); } @Autowired  RequisitionGroupProgramScheduleRepository(
    RequisitionGroupProgramScheduleMapper requisitionGroupProgramScheduleMapper,
    RequisitionGroupMapper requisitionGroupMapper,
    ProgramRepository programRepository,
    ProcessingScheduleMapper processingScheduleMapper,
    FacilityMapper facilityMapper); void insert(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule); void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule); RequisitionGroupProgramSchedule getScheduleForRequisitionGroupAndProgram(Long requisitionGroupId, Long programId); List<Long> getProgramIDsForRequisitionGroup(Long requisitionGroupId); RequisitionGroupProgramSchedule getScheduleForRequisitionGroupCodeAndProgramCode(String requisitionGroupCode, String programCode); List<RequisitionGroupProgramSchedule> getByRequisitionGroupId(Long requisitionGroupId); void deleteRequisitionGroupProgramSchedulesFor(Long requisitionGroupId); }
RequisitionGroupProgramScheduleRepository { public void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule) { populateIdsForRequisitionProgramScheduleEntities(requisitionGroupProgramSchedule); validateRequisitionGroupSchedule(requisitionGroupProgramSchedule); validateProgramType(requisitionGroupProgramSchedule); mapper.update(requisitionGroupProgramSchedule); } @Autowired  RequisitionGroupProgramScheduleRepository(
    RequisitionGroupProgramScheduleMapper requisitionGroupProgramScheduleMapper,
    RequisitionGroupMapper requisitionGroupMapper,
    ProgramRepository programRepository,
    ProcessingScheduleMapper processingScheduleMapper,
    FacilityMapper facilityMapper); void insert(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule); void update(RequisitionGroupProgramSchedule requisitionGroupProgramSchedule); RequisitionGroupProgramSchedule getScheduleForRequisitionGroupAndProgram(Long requisitionGroupId, Long programId); List<Long> getProgramIDsForRequisitionGroup(Long requisitionGroupId); RequisitionGroupProgramSchedule getScheduleForRequisitionGroupCodeAndProgramCode(String requisitionGroupCode, String programCode); List<RequisitionGroupProgramSchedule> getByRequisitionGroupId(Long requisitionGroupId); void deleteRequisitionGroupProgramSchedulesFor(Long requisitionGroupId);  }