ItEr56S13AdaptacionServiciosRESTItEr55S07: Modified calendar model and tests to allow new work week versions in the past.

This commit is contained in:
Manuel Rego Casasnovas 2010-04-27 16:44:04 +02:00 committed by Javier Moran Rua
parent c73d5af641
commit c23f79ca26
2 changed files with 2 additions and 7 deletions

View file

@ -430,11 +430,6 @@ public class BaseCalendar extends IntegrationEntity implements IWorkHours {
* new calendar will be used from that date onwards.
*/
public void newVersion(LocalDate date) throws IllegalArgumentException {
if (date.compareTo(new LocalDate()) <= 0) {
throw new IllegalArgumentException(
"Date for new version must be greater than current date");
}
CalendarData calendarData = getCalendarDataBeforeTheLastIfAny();
if ((calendarData.getExpiringDate() != null)
&& (date.compareTo(calendarData.getExpiringDate()) <= 0)) {

View file

@ -660,8 +660,8 @@ public class BaseCalendarTest {
nullValue());
}
@Test(expected = IllegalArgumentException.class)
public void testNotAllowNewVersionOnCurrentDate() {
@Test
public void testAllowNewVersionOnCurrentDate() {
BaseCalendar calendar = createBasicCalendar();
calendar.newVersion(new LocalDate());