private PlanningState createPlanningStateFor(final Order newOrder) { return adHocTransaction.runOnAnotherReadOnlyTransaction( new IOnTransaction<PlanningState>() { @Override public PlanningState execute() { return planningStateCreator.createOn(mockDesktop(), newOrder); } }); }
private Order givenOrderFromPrepareForCreate() { adHocTransaction.runOnAnotherReadOnlyTransaction( new IOnTransaction<Void>() { @Override public Void execute() { orderModel.prepareForCreate(mockDesktop()); return null; } }); Order order = orderModel.getOrder(); order.setName("name"); order.setCode("code"); order.setInitDate(new Date()); order.setCustomer(createValidExternalCompany()); return order; }