Ejemplo n.º 1
0
 @Test
 @Transactional
 @Ignore("FIXME pending review after rename to libreplan")
 public void testCreation() throws ValidationException {
   Order order = createValidOrder();
   order.setCustomer(createValidExternalCompany());
   orderModel.setPlanningState(createPlanningStateFor(order));
   orderModel.save();
   assertTrue(orderDAO.exists(order.getId()));
 }
Ejemplo n.º 2
0
 @Ignore("Test ignored until having the possibility to have a user " + "session from tests")
 @Test
 @Transactional
 public void testListing() {
   List<Order> list = orderModel.getOrders();
   Order order = createValidOrder();
   order.setCustomer(createValidExternalCompany());
   orderModel.setPlanningState(createPlanningStateFor(order));
   orderModel.save();
   assertThat(orderModel.getOrders().size(), equalTo(list.size() + 1));
 }
Ejemplo n.º 3
0
 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;
 }