ItEr56S13AdaptacionServiciosRESTItEr55S07: Modified calendar model and tests to allow new work week versions in the past.
This commit is contained in:
parent
c73d5af641
commit
c23f79ca26
2 changed files with 2 additions and 7 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue