DropScheduleService { public DateTime getLastDropCreatedDate() { DateTime now = dateTimeUtils.now(dropScheduleConfig.getTimezone()); DateTime lastDropDueDate = getLastDropDueDate(now); return getDropCreatedDate(lastDropDueDate); }  DateTime getLastDropCreatedDate();  }
@Test public void testGetLastDropCreatedDate() { DateTime now = new DateTime("2018-06-08T14:00:00.000-07:00", dateTimeZone); doReturn(now).when(dateTimeUtils).now(dateTimeZone); DateTime expResult = new DateTime("2018-06-06T20:00:00.000-07:00", dateTimeZone); DateTime result = dropSchedule.getLastDropCreatedDate(); assertEquals(expResult, result); }
@Test public void testGetLastDropCreatedDatePreviousWeek() { DateTime now = new DateTime("2018-06-05T14:00:00.000-07:00", dateTimeZone); doReturn(now).when(dateTimeUtils).now(dateTimeZone); DateTime expResult = new DateTime("2018-06-01T20:00:00.000-07:00", dateTimeZone); DateTime result = dropSchedule.getLastDropCreatedDate(); assertEquals(expResult, result); }