@Test public void shouldValidateLineItemForApproval() throws Exception { lineItem.setQuantityApproved(null); expectedException.expect(DataException.class); expectedException.expectMessage(RNR_VALIDATION_ERROR); lineItem.validateForApproval(); }
public void validateForApproval() { if (!skipped && quantityApproved == null) throw new DataException(RNR_VALIDATION_ERROR); }
RnrLineItem extends LineItem { public void validateForApproval() { if (!skipped && quantityApproved == null) throw new DataException(RNR_VALIDATION_ERROR); } }
RnrLineItem extends LineItem { public void validateForApproval() { if (!skipped && quantityApproved == null) throw new DataException(RNR_VALIDATION_ERROR); } RnrLineItem(Long rnrId,
                     FacilityTypeApprovedProduct facilityTypeApprovedProduct,
                     Long modifiedBy,
                     Long createdBy); }
RnrLineItem extends LineItem { public void validateForApproval() { if (!skipped && quantityApproved == null) throw new DataException(RNR_VALIDATION_ERROR); } RnrLineItem(Long rnrId,
                     FacilityTypeApprovedProduct facilityTypeApprovedProduct,
                     Long modifiedBy,
                     Long createdBy); void setFieldsForApproval(); void setBeginningBalanceWhenPreviousStockInHandAvailable(RnrLineItem previousLineItem,
                                                                  Boolean beginningBalanceVisible); void setSkippedValueWhenPreviousLineItemIsAvailable(RnrLineItem previousLineItem); void setLineItemFieldsAccordingToTemplate(ProgramRnrTemplate template); void validateForApproval(); void validateMandatoryFields(ProgramRnrTemplate template); void validateNonFullSupply(); void validateCalculatedFields(ProgramRnrTemplate template); void calculateForFullSupply(ProgramRnrTemplate template,
                                     RnrStatus rnrStatus,
                                     List<LossesAndAdjustmentsType> lossesAndAdjustmentsTypes, Integer numberOfMonths); void calculatePeriodNormalizedConsumption(Integer numberOfMonths); void calculateAmc(Integer numberOfMonths); void calculatePacksToShip(); void calculateMaxStockQuantity( ProgramRnrTemplate template); void calculateOrderQuantity(); void calculateNormalizedConsumption(ProgramRnrTemplate template); void calculateTotalLossesAndAdjustments(List<LossesAndAdjustmentsType> lossesAndAdjustmentsTypes); void calculateQuantityDispensed(); void calculateStockInHand(); Money calculateCost(); void copyCreatorEditableFieldsForFullSupply(RnrLineItem lineItem, ProgramRnrTemplate template); void copyCreatorEditableFieldsForNonFullSupply(RnrLineItem lineItem, ProgramRnrTemplate template); void copyApproverEditableFields(RnrLineItem lineItem, ProgramRnrTemplate template); void addLossesAndAdjustments(LossesAndAdjustments lossesAndAdjustments); @Override boolean compareCategory(LineItem lineItem); @Override String getCategoryName(); @Override String getValue(String columnName); @Override boolean isRnrLineItem(); }
RnrLineItem extends LineItem { public void validateForApproval() { if (!skipped && quantityApproved == null) throw new DataException(RNR_VALIDATION_ERROR); } RnrLineItem(Long rnrId,
                     FacilityTypeApprovedProduct facilityTypeApprovedProduct,
                     Long modifiedBy,
                     Long createdBy); void setFieldsForApproval(); void setBeginningBalanceWhenPreviousStockInHandAvailable(RnrLineItem previousLineItem,
                                                                  Boolean beginningBalanceVisible); void setSkippedValueWhenPreviousLineItemIsAvailable(RnrLineItem previousLineItem); void setLineItemFieldsAccordingToTemplate(ProgramRnrTemplate template); void validateForApproval(); void validateMandatoryFields(ProgramRnrTemplate template); void validateNonFullSupply(); void validateCalculatedFields(ProgramRnrTemplate template); void calculateForFullSupply(ProgramRnrTemplate template,
                                     RnrStatus rnrStatus,
                                     List<LossesAndAdjustmentsType> lossesAndAdjustmentsTypes, Integer numberOfMonths); void calculatePeriodNormalizedConsumption(Integer numberOfMonths); void calculateAmc(Integer numberOfMonths); void calculatePacksToShip(); void calculateMaxStockQuantity( ProgramRnrTemplate template); void calculateOrderQuantity(); void calculateNormalizedConsumption(ProgramRnrTemplate template); void calculateTotalLossesAndAdjustments(List<LossesAndAdjustmentsType> lossesAndAdjustmentsTypes); void calculateQuantityDispensed(); void calculateStockInHand(); Money calculateCost(); void copyCreatorEditableFieldsForFullSupply(RnrLineItem lineItem, ProgramRnrTemplate template); void copyCreatorEditableFieldsForNonFullSupply(RnrLineItem lineItem, ProgramRnrTemplate template); void copyApproverEditableFields(RnrLineItem lineItem, ProgramRnrTemplate template); void addLossesAndAdjustments(LossesAndAdjustments lossesAndAdjustments); @Override boolean compareCategory(LineItem lineItem); @Override String getCategoryName(); @Override String getValue(String columnName); @Override boolean isRnrLineItem(); static final BigDecimal NUMBER_OF_DAYS; static final MathContext MATH_CONTEXT; static final String DISPENSED_PLUS_NEW_PATIENTS; static final String DISPENSED_X_90; static final String DEFAULT; static final String DISPENSED_X_2; static final String CONSUMPTION_X_2; }