springboot測試service簡單demo
阿新 • • 發佈:2017-09-21
boot runner uuid 1-1 一個 script factor wire task
package com.test.service;
import com.task.Application;
import com.task.model.po.TaskRecordDo;
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.SpringJUnit4ClassRunner;
/**
* Created by admin on 2017/9/21-11:33.
* Description :
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class TaskRecordServiceTest {
@Autowired
private TaskRecordService taskRecordService;
@Test
public void insertTest(){
TaskRecordDo taskRecordDo = new TaskRecordDo("8654111110001", "11110001", "adminTask", "UUIDTest", "修改生產服設備ID", "200");
taskRecordService.insertTaskRecord(taskRecordDo);
}
}
*註意 一個簡單的測試單元就這樣成功了
springboot測試service簡單demo