标签:pre 单元 depend alt 测试 image dep contex 点击
引入maven
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency>
单元测试类
DemoApplicationTests.java
package com.example.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class DemoApplicationTests { @Test public void test(){ System.out.println("单元测试------"); } }
点击下方按钮启动
标签:pre 单元 depend alt 测试 image dep contex 点击
原文地址:https://www.cnblogs.com/pxblog/p/13229421.html