@Test public void shouldThrowExceptionIfReportDoesNotContainAgentCode() { Report report = make(a(ReportBuilder.defaultReport, with(ReportBuilder.agentCode, nullString))); expectedException.expect(DataException.class); expectedException.expectMessage("error.mandatory.fields.missing"); report.validate(); }
public void validate() { if (isEmpty(agentCode) || isEmpty(programCode)) { throw new DataException("error.mandatory.fields.missing"); } }
Report { public void validate() { if (isEmpty(agentCode) || isEmpty(programCode)) { throw new DataException("error.mandatory.fields.missing"); } } }
Report { public void validate() { if (isEmpty(agentCode) || isEmpty(programCode)) { throw new DataException("error.mandatory.fields.missing"); } }  }
Report { public void validate() { if (isEmpty(agentCode) || isEmpty(programCode)) { throw new DataException("error.mandatory.fields.missing"); } }  void validate(); Date getClientSubmittedTime(); @JsonIgnore Rnr getRequisition(Long requisitionId, Long modifiedBy); void validateForApproval(); static Report prepareForREST(final Rnr rnr); }
Report { public void validate() { if (isEmpty(agentCode) || isEmpty(programCode)) { throw new DataException("error.mandatory.fields.missing"); } }  void validate(); Date getClientSubmittedTime(); @JsonIgnore Rnr getRequisition(Long requisitionId, Long modifiedBy); void validateForApproval(); static Report prepareForREST(final Rnr rnr);  }