@Test public void shouldInsertRnrSignature() { Rnr rnr = new Rnr(); Signature submitterSignature = new Signature(Signature.Type.SUBMITTER, "Mystique"); Signature approverSignature = new Signature(Signature.Type.APPROVER, "Magneto"); rnr.setRnrSignatures(asList(submitterSignature, approverSignature)); requisitionRepository.insertRnrSignatures(rnr); verify(signatureMapper).insertSignature(rnr.getRnrSignatures().get(0)); verify(signatureMapper).insertSignature(rnr.getRnrSignatures().get(1)); verify(requisitionMapper).insertRnrSignature(rnr, submitterSignature); verify(requisitionMapper).insertRnrSignature(rnr, approverSignature); }
public void insertRnrSignatures(Rnr rnr) { for (Signature signature: rnr.getRnrSignatures()) { signatureMapper.insertSignature(signature); requisitionMapper.insertRnrSignature(rnr, signature); } }
RequisitionRepository { public void insertRnrSignatures(Rnr rnr) { for (Signature signature: rnr.getRnrSignatures()) { signatureMapper.insertSignature(signature); requisitionMapper.insertRnrSignature(rnr, signature); } } }
RequisitionRepository { public void insertRnrSignatures(Rnr rnr) { for (Signature signature: rnr.getRnrSignatures()) { signatureMapper.insertSignature(signature); requisitionMapper.insertRnrSignature(rnr, signature); } }  }
RequisitionRepository { public void insertRnrSignatures(Rnr rnr) { for (Signature signature: rnr.getRnrSignatures()) { signatureMapper.insertSignature(signature); requisitionMapper.insertRnrSignature(rnr, signature); } }  void insert(Rnr requisition); void insertPatientQuantificationLineItems(Rnr rnr); void update(Rnr rnr); void approve(Rnr rnr); Rnr getRequisitionWithLineItems(Facility facility, Program program, ProcessingPeriod period); Rnr getRequisitionWithoutLineItems(Long facilityId, Long programId, Long periodId); Rnr getRegularRequisitionWithLineItems(Facility facility, Program program, ProcessingPeriod period); List<Rnr> getInitiatedOrSubmittedEmergencyRequisitions(Long facilityId, Long programId); List<LossesAndAdjustmentsType> getLossesAndAdjustmentsTypes(); Rnr getById(Long rnrId); @Deprecated List<Rnr> getAuthorizedRequisitions(RoleAssignment roleAssignment); List<RnrDTO> getAuthorizedRequisitionsDTOs(RoleAssignment roleAssignment); Rnr getLastRegularRequisitionToEnterThePostSubmitFlow(Long facilityId, Long programId); List<Rnr> getPostSubmitRequisitions(Facility facility, Program program, List<ProcessingPeriod> periods); Integer getCategoryCount(Rnr requisition, boolean fullSupply); List<Comment> getCommentsByRnrID(Long rnrId); void insertComment(Comment comment); void logStatusChange(Rnr requisition, String name); Date getOperationDateFor(Long rnrId, String status); Rnr getLWById(Long rnrId); List<Rnr> getApprovedRequisitionsForCriteriaAndPageNumber(String searchType, String searchVal, Integer pageNumber,
                                                                   Integer pageSize, Long userId, String rightName, String sortBy,
                                                                   String sortDirection); Integer getCountOfApprovedRequisitionsForCriteria(String searchType, String searchVal, Long userId, String rightName); Long getFacilityId(Long id); Rnr getLastRegularRequisition(Facility facility, Program program); Date getAuthorizedDateForPreviousLineItem(Rnr rnr, String productCode, Date periodStartDate); List<RnrLineItem> getAuthorizedRegularUnSkippedLineItems(String productCode, Rnr rnr, Integer n, Date startDate); RnrLineItem getNonSkippedLineItem(Long rnrId, String productCode); Long getProgramId(Long rnrId); String deleteRnR(Long rnrId); void updateClientFields(Rnr rnr); List<Rnr> getRequisitionDetailsByFacility(Facility facility); void insertRnrSignatures(Rnr rnr); }
RequisitionRepository { public void insertRnrSignatures(Rnr rnr) { for (Signature signature: rnr.getRnrSignatures()) { signatureMapper.insertSignature(signature); requisitionMapper.insertRnrSignature(rnr, signature); } }  void insert(Rnr requisition); void insertPatientQuantificationLineItems(Rnr rnr); void update(Rnr rnr); void approve(Rnr rnr); Rnr getRequisitionWithLineItems(Facility facility, Program program, ProcessingPeriod period); Rnr getRequisitionWithoutLineItems(Long facilityId, Long programId, Long periodId); Rnr getRegularRequisitionWithLineItems(Facility facility, Program program, ProcessingPeriod period); List<Rnr> getInitiatedOrSubmittedEmergencyRequisitions(Long facilityId, Long programId); List<LossesAndAdjustmentsType> getLossesAndAdjustmentsTypes(); Rnr getById(Long rnrId); @Deprecated List<Rnr> getAuthorizedRequisitions(RoleAssignment roleAssignment); List<RnrDTO> getAuthorizedRequisitionsDTOs(RoleAssignment roleAssignment); Rnr getLastRegularRequisitionToEnterThePostSubmitFlow(Long facilityId, Long programId); List<Rnr> getPostSubmitRequisitions(Facility facility, Program program, List<ProcessingPeriod> periods); Integer getCategoryCount(Rnr requisition, boolean fullSupply); List<Comment> getCommentsByRnrID(Long rnrId); void insertComment(Comment comment); void logStatusChange(Rnr requisition, String name); Date getOperationDateFor(Long rnrId, String status); Rnr getLWById(Long rnrId); List<Rnr> getApprovedRequisitionsForCriteriaAndPageNumber(String searchType, String searchVal, Integer pageNumber,
                                                                   Integer pageSize, Long userId, String rightName, String sortBy,
                                                                   String sortDirection); Integer getCountOfApprovedRequisitionsForCriteria(String searchType, String searchVal, Long userId, String rightName); Long getFacilityId(Long id); Rnr getLastRegularRequisition(Facility facility, Program program); Date getAuthorizedDateForPreviousLineItem(Rnr rnr, String productCode, Date periodStartDate); List<RnrLineItem> getAuthorizedRegularUnSkippedLineItems(String productCode, Rnr rnr, Integer n, Date startDate); RnrLineItem getNonSkippedLineItem(Long rnrId, String productCode); Long getProgramId(Long rnrId); String deleteRnR(Long rnrId); void updateClientFields(Rnr rnr); List<Rnr> getRequisitionDetailsByFacility(Facility facility); void insertRnrSignatures(Rnr rnr);  }