private Order givenValidOrderWithValidOrderLinesAlreadyStored() { Order order = givenOrder(); jiraOrderElementSynchronizer.syncOrderElementsWithJiraIssues(issues, order); order.dontPoseAsTransientObjectAnymore(); orderDAO.saveWithoutValidating(order); orderDAO.flush(); try { return orderDAO.find(order.getId()); } catch (InstanceNotFoundException e) { return null; } }
private Order givenValidOrderAlreadyStored() { Order order = Order.create(); order.setCode(UUID.randomUUID().toString()); order.setName("Order name " + UUID.randomUUID()); order.setInitDate(new Date()); order.setCalendar(configurationDAO.getConfiguration().getDefaultCalendar()); OrderVersion version = setupVersionUsing(scenarioManager, order); order.useSchedulingDataFor(version); orderDAO.save(order); orderDAO.flush(); try { return orderDAO.find(order.getId()); } catch (InstanceNotFoundException e) { return null; } }