1.引入pom
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
2.创建测试类
test文件下创建测试类
package com.jmanager;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @Description: 单元测试
* @Author zhou
* @Date 2022/7/1 - 17:14
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class MavenDemoTest {
@Test
public void bd_wide_stop() {
System.out.println("单元测试");
}
}