有没有办法使用 Awaitility 来断言没有任何改变?我想验证一个主题没有被写入,但是因为没有状态变化,Awaitility 不喜欢这样。例如,此代码给出以下错误。谢谢
@Test
fun waitUntilListMightBePopulated() {
val myTopic: List<String> = emptyList()
await.atLeast(2, TimeUnit.SECONDS).pollDelay(Duration.ONE_SECOND).until {
myTopic.isEmpty()
}
}
ConditionTimeoutException: Condition was evaluated in 1005478005 NANOSECONDS which is earlier than expected minimum timeout 2 SECONDS