– Start
在开始学习 JUnit 之前,你需要先创建一个 Maven 项目,然后添加下面的依赖。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>shangbo</groupId>
<artifactId>junit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage -->
<!-- JUnit Platform -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>1.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifa