WeeklyPeriod implements Period { @Override public Date getStartDate() { return startDate; } WeeklyPeriod(Date date); @Override void setStartDate(Date startDate); @Override void setEndDate(Date endDate); @Override Date getStartDate(); @Override Date getEndDate(); @Override String getAsIsoString(); static final String ISO_FORMAT; }
@Test public void testGetStart() throws ParseException { WeeklyPeriod instance = new WeeklyPeriod(new SimpleDateFormat( "yyyy-MM-dd").parse("2012-11-20")); Date expResult = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS") .parse("2012-11-19T00:00:00.000"); Date result = instance.getStartDate(); assertEquals(expResult, result); }