package com.example.demo;
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;
/**
* <p>Description : demo
* <p>Date : 2018/5/23 17:28
* <p>@author : Mcj
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class test2 {
@Autowired
test test;
@Test
public void ad(){
System.out.println("dsd");
test.sss();
}
}
加入springbootTest 注解
加入junit注解
在测试方法上加入@Test 注解 即可