task = givenTaskWithCriterions();
givenGenericResourceAllocationForTask(task);
}
private Task givenTaskWithStartAndEnd(Interval interval) {
Task task = createNiceMock(Task.class);
setupCriterions(task);
IntraDayDate start = IntraDayDate.startOfDay(interval.getStart()
.toLocalDate());
IntraDayDate end = IntraDayDate.startOfDay(interval.getEnd()
.toLocalDate());
expect(task.getStartDate()).andReturn(interval.getStart().toDate())
.anyTimes();
expect(task.getIntraDayStartDate()).andReturn(start).anyTimes();
expect(task.getEndDate()).andReturn(interval.getEnd().toDate())
.anyTimes();
expect(task.getIntraDayEndDate()).andReturn(end).anyTimes();
expect(task.getFirstDayNotConsolidated()).andReturn(start)
.anyTimes();
expect(task.getCalendar()).andReturn(baseCalendar).anyTimes();
replay(task);
return this.task = task;
}