@Test public void shouldThrowExceptionIfPackSizeIsZero() throws Exception { Product product = new Product(); product.setPackSize(0); expectedException.expect(DataException.class); expectedException.expectMessage("error.invalid.pack.size"); product.validate(); }
public void validate() { if (this.packSize <= 0) { throw new DataException("error.invalid.pack.size"); } }
Product extends BaseModel implements Importable { public void validate() { if (this.packSize <= 0) { throw new DataException("error.invalid.pack.size"); } } }
Product extends BaseModel implements Importable { public void validate() { if (this.packSize <= 0) { throw new DataException("error.invalid.pack.size"); } }  }
Product extends BaseModel implements Importable { public void validate() { if (this.packSize <= 0) { throw new DataException("error.invalid.pack.size"); } }  void validate(); @JsonIgnore String getName(); }
Product extends BaseModel implements Importable { public void validate() { if (this.packSize <= 0) { throw new DataException("error.invalid.pack.size"); } }  void validate(); @JsonIgnore String getName();  }