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.
当我不在网络上访问共享资源时,运行某些测试毫无意义。离线运行这些测试将导致测试失败和异常。
是否可以将给定的测试设置为仅在满足某些条件时才运行,例如,当有网络连接时?
这听起来像是一个假设的工作。
@Test public void someTestThatNeedsNetworkConnectivity() { assumeTrue(thereIsNetworkConnectivity()); // ... }