Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
使用 gradle 在 intellij 中从 JUnit 4 升级到 JUnit 5
我想将我的 Gradle 项目测试从 JUnit 4 转换为 JUnit 5 由于有很多测试 我不想同时转换它们 我尝试配置我的build gradle像这样 apply plugin java compileTestJava source
intellijidea
Gradle
Junit4
Junit5
如何测试扩展实现
JUnit 5 API 中有多个可用的扩展点 例如 AfterEachCallback http junit org junit5 docs current api org junit jupiter api extension After
Junit5
使用 Mockito 2 模拟服务会导致存根错误
我尝试使用 Mockito 模拟类的行为 这使用 Mockito 1 x 有效 迁移到 JUnit 5 和 Mockito 2 似乎不再起作用了 ExtendWith MockitoExtension class public class
Java
unittesting
mocking
Mockito
Junit5
如何测试 JUnit Jupiter (JUnit 5) 扩展
有没有办法集成测试我的 JUnit Jupiter 扩展 当然 我可以测试扩展使用的良好案例 但我想测试以下内容 它是否按预期失败了测试 测试结束时所写的报告是否正确 有对此有一些内置支持吗 没有明确的 Jupiter 扩展测试框架 但在
Testing
Junit5
JUnit 5 有类似 Cucumber 的标记钩子的东西吗?
有没有办法像 Cucumber 一样在 JUnit5 中用钩子注释单个测试 例如 在黄瓜中 可以编写像这样的钩子 Before SomeTest public void beforeSomeTest 然后 如果我们使用 SomeTest 注
Java
JUnit
automatedtests
cucumber
Junit5
Maven 测试无法使用 Spring Boot 2.2 和 JUnit 5 运行 Cucumber 场景
我正在 Spring Boot 2 2 6 上尝试 JUnit 5 和 Cucumber 并且在我的应用程序中需要 BDD 场景和单元测试 我已经创建了一个虚拟 ping 控制器对应的功能文件 一切正常 我运行时不会调用黄瓜测试mvn cl
Java
Spring
springboot
cucumber
Junit5
测试不通过 Maven 运行?
当我在 Maven 中运行测试时 我得到以下信息 INFO INFO T E S T S INFO INFO INFO Results INFO INFO Tests run 0 Failures 0 Errors 0 Skipped 0
Java
Maven
unittesting
JUnit
Junit5
在 JUnit5 (Eclipse) 中创建 TestSuite
我在 eclipse 中创建了多个测试用例 java 文件 JUnit 的版本是 JUnit5 现在 我尝试通过 eclipse GUI 创建 Junit TestSuite 在创建过程中 我没有在可用版本中看到 JUnit5 这是我为创建
Java
unittesting
Junit5
如何在JUnit 5的“@BeforeEach”方法中打印“要执行”的@Test方法的名称?
我知道我们可以在 JUnit 4 中使用 Rule and TestName但是我正在使用 JUnit 5 Jupiter 并且正在努力寻找一种方法来打印测试方法 要执行的 名称 BeforeEach method 声明一个TestInfo
Junit5
使用 JUnit 5 并行执行测试用例
是否可以与 JUnit 5 并行执行测试用例 我正在寻找类似的东西threadPoolSize and invocationCount from TestNG http testng org doc documentation main h
Java
JUnit
Junit5
JUnit5-Jupiter:组合(=“元”)注释无法解析为注释定义
我定义了自己的 JUnit 注释 ParameterizedTest MethodSource myorg qa ccrtesting DataProviders standardDataProvider Tags Tag ccr Tag
Java
Reflection
annotations
Junit5
junitjupiter
Cucumber @Before 钩子运行两次 @After 一次
给所有人 目前正在写一个BDD测试自动化框架 使用Java11 Junit5 Cucumber Selenium 构建工具 Gradle 创建了一个用于验证 Google 标题的小测试 开始测试时 使用Test task在 Gradle 或
无法使用 Gradle 6.1.1 解析 junit-jupiter-params:5.6.2 和 junit-jupiter-engine:5.6.2
我有一个 Android 项目 其中包含 2 个 Android 模块和 1 个纯 Java 模块 将 android 构建工具更新为 com android tools build gradle 4 0 0 并将 gradle 包装器更新
Android
Gradle
JUnit
Junit5
在 IntelliJ 中将特定测试从 JUnit 4 迁移到 JUnit 5
我正在尝试将测试文件从 Junit 4 迁移到 Junit 5 使用 IntelliJ 重构代码 gt 迁移 gt junit 4 到 junit 5 但它只运行导入优化并显示项目中的所有单元测试 并询问重构是或否 当我选择重构时什么也没有
Java
intellijidea
JUnit
Junit5
@DirtiesContext 不适用于 @Nested 测试
经过几个小时的谷歌研究后我仍然不知道如何使用 DirtiesContext with Nested类 假设以下集成测试类 ExtendWith SpringExtension class SpringBootTest AutoConfigu
springboot
integrationtesting
Junit5
模拟挂起 lambda 在 Mockito 中返回 null
依赖关系 testImplementation androidx arch core core testing 2 0 0 testImplementation org mockito mockito core 3 3 0 testImpl
kotlin
mocking
Mockito
Junit5
Cucumber 在 JUnit5 中找不到任何功能
我正在尝试在我的项目中设置 Cucumber 我遵循以前项目中的相同配置 但运行测试时仍然存在问题 现在我开始怀疑问题可能是这个项目使用的是 JUnit 5 而不是 4 我也将 junit4 添加到构建选项中 以便能够使用 jUnit4 执
cucumber
Junit5
cucumberjunit
在 JUnit 5 中超过超时后如何使测试失败?
在 JUnit 4 中 timeout 注释参数可用于强制测试在给定时间后停止 Test timeout 100 public void infinity while true 在 JUnit 5 中如何做到这一点 与 以及摘自的代码 密切
Java
JUnit
Junit5
JUnit 5:如何断言抛出异常?
在 JUnit 5 中是否有更好的方法来断言方法抛出异常 目前 我必须使用 Rule 来验证我的测试是否引发异常 但这不适用于我期望多个方法在测试中引发异常的情况 您可以使用assertThrows https github com jun
Java
JUnit
Junit5
junitjupiter
@Disabled 在 JUnit5 中不起作用
我想在 Maven 项目中使用 Junit 5
Java
eclipse
Junit5
«
1
2
3
4
5
»