在基于Junit5编写测试代码时,expectedThrows()方法找不到。
百度和google都没有答案,最后检索JUnit5官方文档得知:
Deprecations and Breaking Changes:
- Removed deprecated Assertions.expectThrows() method in favor of Assertions.assertThrows().
弃用和重大变化:
- 删除了已弃用的Assertions.expectThrows()方法,取而代之的是Assertions.assertThrows()。
希望以后遇到同样问题的小伙伴能直接百度到此。
本文介绍了在JUnit5中已弃用的Assertions.expectThrows()方法被替换为assertThrows()的方法变更,帮助开发者解决在新版本中遇到的问题。
1959

被折叠的 条评论
为什么被折叠?



