– Start
在开始学习 Hamcrest 之前,你需要先创建一个 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>hamcrest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>hamcrest test</description>
<dependencies>
<!-- 注意 hamcrest 依赖放在最前面-->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit Jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.5.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
– 更多参见:Hamcrest 精萃
– 声 明:转载请注明出处
– Last Updated on 2019-08-13
– Written by ShangBo on 2019-08-13
– End