JUnit中断言嵌套映射的几种方式
在本教程中,我们将介绍一些不同的方法来断言在外部映射中存在一个嵌套映射。我们主要讨论JUnit Jupiter API和Hamcrest API。
2. 使用Jupiter API进行断言
本文使用Junit 5,让我们看看Maven依赖项:
``<dependency>``
``<groupId>``org.junit.jupiter``</groupId>``
``<artifactId>``junit-jupiter-engine``</artifactId>``
``<version>``5.10.2``</version>``
``<scope>``test``</scope>``
``</dependency>``