}
});
}
private Order createValidOrder() {
Order order = Order.create();
order.setDescription("description");
order.setInitDate(year(2000));
order.setName("name");
order.setResponsible("responsible");
order.setCode("code-" + UUID.randomUUID());
BaseCalendar calendar = adHocTransaction
.runOnReadOnlyTransaction(new IOnTransaction<BaseCalendar>() {
@Override
public BaseCalendar execute() {
BaseCalendar result = configurationDAO
.getConfigurationWithReadOnlyTransaction()
.getDefaultCalendar();
BaseCalendarModel.forceLoadBaseCalendar(result);
return result;
}
});
order.setCalendar(calendar);
return order;
}