springboot test方法


import com.lanfu.storehouse.MessageApplication;
import com.lanfu.storehouse.dao.mapper.PushMessageLogMapper;
import com.lanfu.storehouse.dto.req.wx.EntityVo;
import com.lanfu.storehouse.enums.InvoiceRecordTypeIntEnums;
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 org.springframework.test.context.web.WebAppConfiguration;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {MessageApplication.class})//需要的启动类
@WebAppConfiguration//web项目
public class Test001 {
@Autowired
private PushMessageLogMapper invoiceRecordMapper;

@Test
public void test000(){
EntityVo entityVo = new EntityVo("", "", InvoiceRecordTypeIntEnums.descOf(1), "蓝服控股", "1.00" + "元", "");
System.out.println("entityVo = " + entityVo);
}
}
posted @ 2021-10-13 13:26  天才淇露洛  阅读(961)  评论(0编辑  收藏  举报