@Test public void shouldThrowExceptionIfPricePerDosageIsNegativeOnValidation() throws Exception { ProgramProduct programProduct = make(a(ProgramProductBuilder.defaultProgramProduct)); programProduct.setCurrentPrice(new Money("-0.01")); expectException.expect(DataException.class); expectException.expectMessage("programProduct.invalid.current.price"); programProduct.validate(); }
public void validate() { if (currentPrice.isNegative()) throw new DataException("programProduct.invalid.current.price"); }
ProgramProduct extends BaseModel implements Importable { public void validate() { if (currentPrice.isNegative()) throw new DataException("programProduct.invalid.current.price"); } }
ProgramProduct extends BaseModel implements Importable { public void validate() { if (currentPrice.isNegative()) throw new DataException("programProduct.invalid.current.price"); } ProgramProduct(Long id);  ProgramProduct(Program program, Product product, Integer dosesPerMonth, Boolean active);  ProgramProduct(Program program, Product product, Integer dosesPerMonth, Boolean active, Money currentPrice);  ProgramProduct(ProgramProduct programProduct); }
ProgramProduct extends BaseModel implements Importable { public void validate() { if (currentPrice.isNegative()) throw new DataException("programProduct.invalid.current.price"); } ProgramProduct(Long id);  ProgramProduct(Program program, Product product, Integer dosesPerMonth, Boolean active);  ProgramProduct(Program program, Product product, Integer dosesPerMonth, Boolean active, Money currentPrice);  ProgramProduct(ProgramProduct programProduct); void validate(); }
ProgramProduct extends BaseModel implements Importable { public void validate() { if (currentPrice.isNegative()) throw new DataException("programProduct.invalid.current.price"); } ProgramProduct(Long id);  ProgramProduct(Program program, Product product, Integer dosesPerMonth, Boolean active);  ProgramProduct(Program program, Product product, Integer dosesPerMonth, Boolean active, Money currentPrice);  ProgramProduct(ProgramProduct programProduct); void validate();  }