我目前正在使用Mockito来模拟Spring MVC应用程序中的服务层对象,我想在其中测试我的Controller方法.然而,正如我一直在阅读Mockito的具体细节,我发现这些方法doReturn(...).when(...)相当于when(...).thenReturn(...).所以,我的问题是什么是有两个方法,做同样的事情或之间有什么细微的区别点doReturn(...).when(...)和when(...).thenReturn(...)?
doReturn(...).when(...)
when(...).thenReturn(...)
任何帮助,将不胜感激.
java unit-testing mockito
java ×1
mockito ×1
unit-testing ×1