码迷,mamicode.com
首页 > 编程语言 > 详细

springboot测试service简单demo

时间:2017-09-21 14:53:39      阅读:496      评论:0      收藏:0      [点我收藏+]

标签:create   单元   new   注意   ott   record   tor   package   run   

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

标签:create   单元   new   注意   ott   record   tor   package   run   

原文地址:http://www.cnblogs.com/xubiao/p/7568257.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!