@Test public void shouldNotThrowErrorOnValidateForAPeriodWithNoEndDate() { ProcessingPeriod processingPeriod = make(a(defaultProcessingPeriod)); processingPeriod.setEndDate(null); exException.expect(dataExceptionMatcher("error.period.without.end.date")); processingPeriod.validate(); }
public void validate() { if (scheduleId == null) { throw new DataException("error.period.without.schedule"); } if (startDate == null || startDate.toString().isEmpty()) { throw new DataException("error.period.without.start.date"); } if (endDate == null || endDate.toString().isEmpty()) { throw new DataException("error.period.without.end.date"); } if (isBlank(name)) { throw new DataException("error.period.without.name"); } if (endDate.compareTo(startDate) <= 0) { throw new DataException("error.period.invalid.dates"); } }
ProcessingPeriod extends BaseModel { public void validate() { if (scheduleId == null) { throw new DataException("error.period.without.schedule"); } if (startDate == null || startDate.toString().isEmpty()) { throw new DataException("error.period.without.start.date"); } if (endDate == null || endDate.toString().isEmpty()) { throw new DataException("error.period.without.end.date"); } if (isBlank(name)) { throw new DataException("error.period.without.name"); } if (endDate.compareTo(startDate) <= 0) { throw new DataException("error.period.invalid.dates"); } } }
ProcessingPeriod extends BaseModel { public void validate() { if (scheduleId == null) { throw new DataException("error.period.without.schedule"); } if (startDate == null || startDate.toString().isEmpty()) { throw new DataException("error.period.without.start.date"); } if (endDate == null || endDate.toString().isEmpty()) { throw new DataException("error.period.without.end.date"); } if (isBlank(name)) { throw new DataException("error.period.without.name"); } if (endDate.compareTo(startDate) <= 0) { throw new DataException("error.period.invalid.dates"); } } ProcessingPeriod(Long id);  ProcessingPeriod(Long id, Date startDate, Date endDate, Integer numberOfMonths, String name); }
ProcessingPeriod extends BaseModel { public void validate() { if (scheduleId == null) { throw new DataException("error.period.without.schedule"); } if (startDate == null || startDate.toString().isEmpty()) { throw new DataException("error.period.without.start.date"); } if (endDate == null || endDate.toString().isEmpty()) { throw new DataException("error.period.without.end.date"); } if (isBlank(name)) { throw new DataException("error.period.without.name"); } if (endDate.compareTo(startDate) <= 0) { throw new DataException("error.period.invalid.dates"); } } ProcessingPeriod(Long id);  ProcessingPeriod(Long id, Date startDate, Date endDate, Integer numberOfMonths, String name); void validate(); void includeEntireDuration(); @SuppressWarnings("unused") String getStringStartDate(); @SuppressWarnings("unused") String getStringEndDate(); String getStringYear(); String getNextStartDate(); }
ProcessingPeriod extends BaseModel { public void validate() { if (scheduleId == null) { throw new DataException("error.period.without.schedule"); } if (startDate == null || startDate.toString().isEmpty()) { throw new DataException("error.period.without.start.date"); } if (endDate == null || endDate.toString().isEmpty()) { throw new DataException("error.period.without.end.date"); } if (isBlank(name)) { throw new DataException("error.period.without.name"); } if (endDate.compareTo(startDate) <= 0) { throw new DataException("error.period.invalid.dates"); } } ProcessingPeriod(Long id);  ProcessingPeriod(Long id, Date startDate, Date endDate, Integer numberOfMonths, String name); void validate(); void includeEntireDuration(); @SuppressWarnings("unused") String getStringStartDate(); @SuppressWarnings("unused") String getStringEndDate(); String getStringYear(); String getNextStartDate();  }