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