@Test public void shouldThrowErrorIfSerialNumberBlank() throws Exception { Refrigerator refrigerator = new Refrigerator("", "", null, 3L, true); expectedException.expect(DataException.class); expectedException.expectMessage("error.invalid.reading.value"); refrigerator.validate(); }
public void validate() { if (isBlank(serialNumber)) { throw new DataException("error.invalid.reading.value"); } }
Refrigerator extends BaseModel { public void validate() { if (isBlank(serialNumber)) { throw new DataException("error.invalid.reading.value"); } } }
Refrigerator extends BaseModel { public void validate() { if (isBlank(serialNumber)) { throw new DataException("error.invalid.reading.value"); } } Refrigerator(String serialNumber); }
Refrigerator extends BaseModel { public void validate() { if (isBlank(serialNumber)) { throw new DataException("error.invalid.reading.value"); } } Refrigerator(String serialNumber); void validate(); }
Refrigerator extends BaseModel { public void validate() { if (isBlank(serialNumber)) { throw new DataException("error.invalid.reading.value"); } } Refrigerator(String serialNumber); void validate();  }