File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Mockito selective use of matchers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mockito selective use of matchers" Watch "Mockito selective use of matchers" New topic

Mockito selective use of matchers

Joseph Abraham

Joined: Jun 05, 2013
Posts: 1

I am trying to clean up the unit test code.

I have a line of code in the setup (@Before) which says


But I want to account for the fact that this method may return true in a particular scenario. eg. mockXX.hasProp("id").thenReturn(true)

Any suggestions on how to go about handling this?
I agree. Here's the link:
subject: Mockito selective use of matchers
It's not a secret anymore!