service的测试OrderServerImplTest

package com.example.demo.service.Impl;


import com.example.demo.dataobject.OrderDetail;
import com.example.demo.dto.OrderDTO;



import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.List;



@RunWith(SpringRunner.class)
@SpringBootTest
public  class OrderServerImplTest {
    @Autowired
    private  OrderServerImpl orderServer;
  private  final  String BUYER_OPENID="110110";
    @Test
    public void create() {
        OrderDTO orderDTO=new OrderDTO();
        orderDTO.setBuyerName("大师兄");
        orderDTO.setBuyerAddress("安徽省合肥市");
        orderDTO.setBuyerPhone("1232342342");
        orderDTO.setBuyerOpenid(BUYER_OPENID);

        //购物车
        List orderDetailList=new ArrayList<>();
         OrderDetail  o1=new OrderDetail();
         o1.setProductId("123456");
         o1.setProductQuantity(1);
         orderDetailList.add(o1);

        orderDTO.setOrderDetailList(orderDetailList);

        orderServer.create(orderDTO);
//        l.i("[创建订单] result="+result);

    }

    @Test
    public  void findOne() {
    }

    @Test
    public void findList() {
    }

    @Test
    public void cancel() {
    }

    @Test
    public void finash() {
    }

    @Test
    public void paid() {
    }
}

你可能感兴趣的:(service的测试OrderServerImplTest)