[英]Mockito ArgumentCaptor verify that nothing is captured
I need to verify that the ArgumentCaptor has not captured anything.我需要验证 ArgumentCaptor 没有捕获任何东西。 Is there any way to verify this?
有没有办法验证这一点?
Mockito.verify( /* captor has not captured anything */ )
您可以验证捕获的值的数量是否为零。
Assert.assertEquals(0, captor.getAllValues().size());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.