问答式问题,因为现有问题与我在此处所做的简单拼写错误不符:
Goal
- 使用 UI 通过 IntelliJ IDE 执行简单的 JUnit 测试(右键单击:运行测试)
Problem
Code
import org.junit.jupiter.api.Test;
public class Test {
@Test
private void testAMethod() { (...) }
}
改成
public void testAMethod() { (...) }
根据Junit5文档
测试类、测试方法和生命周期方法不需要
是公开的,但不能是私人的。
https://junit.org/junit5/docs/current/user-guide/ https://junit.org/junit5/docs/current/user-guide/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)