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); }} *注意 一个简单的测试单元就这样成功了
时间: 2024-10-06 10:07:48