Skip to content

Instantly share code, notes, and snippets.

@kevinpet
Created November 12, 2012 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinpet/4060766 to your computer and use it in GitHub Desktop.
Save kevinpet/4060766 to your computer and use it in GitHub Desktop.
Test to update the market
@Test
public void testNeedToUpdateHolidaysBeforeNextYear() throws Exception {
DateTime now = new DateTime(ET);
DateTime warningDate = new DateTime(2012, 12, 15, 0, 0, 0, 0, ET);
LocalDate newYearsDate = new LocalDate(warningDate.getYear()+1, 1, 1);
/**
* Once you update the holidays in Market.java, increment the year in this test
* so it passes until next year.
*/
LocalDate lastHoliday = Ordering.natural().max(HOLIDAYS);
if (!lastHoliday.isAfter(newYearsDate)) {
assertTrue(now.compareTo(warningDate) < 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment