Java – how to use mockito to display all simulated calls

One of my units failed the test. I'm not sure why I want to be able to see all simulated calls that occur in the system under test This is not the behavior of all tests I want, just for testing, I need to adjust quickly to determine what is wrong

But it seems like a hacker Can I do this locally in mockito without using thread currentThread(). getStackTrace()?

This is not preferred because stack traces include all other calls used internally by mockito

Solution

This feature is from mockito 1.9 5 start building Just use

mock(ClassToMock.class,withSettings().verboseLogging())
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>