Mockito verify no more interactions but omit getters
- by michael lucas
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.