小编AVN*_*AVN的帖子

@Test(expected = Exception.class) 或 Assertions.assertThrows(...) 或 assertThatThrownBy(..) 推荐哪一个?

我正在使用 JUnit 4.12

<dependency>
    <groupId>pl.pragmatists</groupId>
    <artifactId>JUnitParams</artifactId>
    <version>1.0.5</version>
    <scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

我想知道哪一个是最值得推荐的使用 @Test(expected = Exception.class)Assertions.assertThrows(...)

java junit unit-testing

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

junit ×1

unit-testing ×1