Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Java 测试无法编译,我运行它并拥有:
没有junit测试找不到主类(在运行配置中指定)
你的类中没有任何@Test方法。
@Test
JUnit4 查找带有注释的方法@Test- 如果在类中找不到任何方法,则完全忽略该类。
我同意彼得
@测试 公共无效 testSomeBehavior() { assertEquals("空列表应该有 0 个元素", 0, emptyList.size()); }