我读到,当使用@Mock时,它应该与@RunWith(MockitoJUnitRunner.class)一起使用,而对于@MockBean,它应该与@RunWith(SpringRunner.class)一起使用。@RunWith(MockitoJUnitRunner.class) // also work when @RunWith(SpringRunner.class) is used
public class testS
我试图为我的kotlin spring应用程序编写一个集成测试。为此,我使用kotlintest框架。因为我需要模拟应用程序中的一个bean,所以我还用springmockk扩展添加了mockk。我注意到,一旦springmockk被添加到gradle testImplement依赖项中,就会发生这种情况,它甚至不需要导入到应用程序代码本身中。buildscript { ex
我正在试着测试像这样的事件侦听器。handler(event: SomeEvent) { //SomeEvent is has properties source and someObject }我的测试采用这种格式call 1 of 1: EventHandler(#4).handler(matcher<SomeEvent>())) was not called
但是,通过使用调试器,我可以看到handler函数输入的参数是正确的那么,为什么