SpringBoot单元测试样例
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; /** * @author :潘潘 * @date :2020/10/14 16:22 * @description:${description} */ @RunWith(SpringRunner.class) @SpringBootTest public class TestClass { @Test public void getLearn(){ System.out.println("开始"); System.out.println("结束"); } }
这里面的@Test的注解导包需要注意,可能不小心导错