1、添加maven依赖
<!-- 添加test方便测试-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
2、测试代码
import org.junit.Test;
public class MyServiceTest2 {
@Test
public void testMyService() {
System.out.println ("测试!!!" );
}
}