@Test public void shouldIncludeEndDateInPeriod() throws Exception { ProcessingPeriod processingPeriod = make(a(defaultProcessingPeriod)); processingPeriod.includeEntireDuration(); assertThat(processingPeriod.getStartDate(), is(DateUtils.parseDate("01-01-12 00:00:00", new String[]{"dd-MM-yy HH:mm:ss"}))); assertThat(processingPeriod.getEndDate(), is(DateUtils.parseDate("01-02-12 23:59:59", new String[]{"dd-MM-yy HH:mm:ss"}))); }
public void includeEntireDuration() throws ParseException { SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormatWithTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); startDate = dateFormatWithoutTime.parse(dateFormatWithoutTime.format(startDate) + " 00:00:00"); endDate = dateFormatWithTime.parse(dateFormatWithoutTime.format(endDate) + " 23:59:59"); }
ProcessingPeriod extends BaseModel { public void includeEntireDuration() throws ParseException { SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormatWithTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); startDate = dateFormatWithoutTime.parse(dateFormatWithoutTime.format(startDate) + " 00:00:00"); endDate = dateFormatWithTime.parse(dateFormatWithoutTime.format(endDate) + " 23:59:59"); } }
ProcessingPeriod extends BaseModel { public void includeEntireDuration() throws ParseException { SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormatWithTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); startDate = dateFormatWithoutTime.parse(dateFormatWithoutTime.format(startDate) + " 00:00:00"); endDate = dateFormatWithTime.parse(dateFormatWithoutTime.format(endDate) + " 23:59:59"); } ProcessingPeriod(Long id);  ProcessingPeriod(Long id, Date startDate, Date endDate, Integer numberOfMonths, String name); }
ProcessingPeriod extends BaseModel { public void includeEntireDuration() throws ParseException { SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormatWithTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); startDate = dateFormatWithoutTime.parse(dateFormatWithoutTime.format(startDate) + " 00:00:00"); endDate = dateFormatWithTime.parse(dateFormatWithoutTime.format(endDate) + " 23:59:59"); } 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 includeEntireDuration() throws ParseException { SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormatWithTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); startDate = dateFormatWithoutTime.parse(dateFormatWithoutTime.format(startDate) + " 00:00:00"); endDate = dateFormatWithTime.parse(dateFormatWithoutTime.format(endDate) + " 23:59:59"); } 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();  }