Mockito verify no more interactions but omit getters
Posted
by michael lucas
on Stack Overflow
See other posts from Stack Overflow
or by michael lucas
Published on 2010-05-27T11:11:28Z
Indexed on
2010/06/13
9:02 UTC
Read the original article
Hit count: 316
Mockito api provides method:
Mockito.verifyNoMoreInteractions(someMock);
but is it possible in Mockito to declare that I don't want more interactions with a given mock with the exceptions of interactions with its getter methods?
The simple scenario is the one in which I test that sut changes only certain properties of a given mock and lefts other properties untapped.
In example I want to test that UserActivationService changes property Active on an instance of class User but does't do anything to properties like Role, Password, AccountBalance, etc.
I'm open to criticism regarding my approach to the problem.
© Stack Overflow or respective owner