Example #1
0
 public void orderTest3() {
   Customer customer = customerDAO.getCustomerById(2);
   List list = orderService.getOrdersByUsername(customer.getUsername());
   System.out.println("List size :" + list.size());
   for (Object obj : list) {
     System.out.println(obj);
   }
 }
Example #2
0
  public void paymentTest() {
    Payment payment = new Payment();
    // 取出订单
    Order order = orderDAO.getOrderById(8);
    // 取出订单顾客
    Customer customer = order.getCustomer();
    // 取出操作员
    Worker worker = workerDAO.getWorkerById(7);
    // 取出银行卡
    Bankcard bankcard = customer.getBankcardList().get(0);

    payment.setPayCustomer(customer);
    System.out.println("OrderId:" + order.getOrderId());
    payment.setPayOrder(order);
    System.out.println(bankcard);
    payment.setPayCard(bankcard);
    payment.setPayPrice(order.getOrderPrice());
    payment.setPayType(1);
    payment.setWorker(worker);

    paymentDAO.createPayment(payment);
  }
Example #3
0
 public void testGetCustomerById() {
   List list = (List) customerDAO.getCustomerById(1);
   Customer cus = (Customer) list.get(0);
   assertEquals("赵小明", cus.getUsername());
 }