junit - 在 Kotlin 和 JUnit 5 中重复使用 @ExtendWith
问题描述
我在 Kotlin 项目中使用 JUnit 5 并观察与文档不匹配的行为。在测试类上使用多个@ExtendWith
注释时,我收到以下错误:
Repeatable annotations with non-SOURCE retention are not yet supported
在Extension
JUnit 文档的部分中,这被列为有效选项。
我正在使用 Kotlin 1.3.10 和 JUnit 5.3.2
为什么我无法@ExtendWith
在我的测试类上重复注释?
解决方案
Kotlin 尚不支持可重复的注解。但是,您可以使用Extensions注释:
@Extensions(
ExtendWith(...),
ExtendWith(...)
)
推荐阅读
- jquery - jQuery 间隔刷新是否为在该页面中打开的每个用户分别重新加载 div?
- php - PHP,根据数组值的开头删除简单数组中的一些元素
- c# - c# odbc 更新查询不能正常工作
- java - 您如何等待动态 Web 表格中的元素?
- intellij-idea - 为什么我在反编译的类中看到 lombok 导入
- php - strftime 令人难以置信的行为
- excel - 如何根据 Excel/Googlesheet 中每个单元格的行标题(重复)和列标题(重复)对所有单元格求和?
- javascript - 如何通过单击空格来拆分句子
- uipath - 使用 UiPath 从 PDF 中获取选中值的文本
- jquery - 徽章未在引导程序中正确加载