« Return to Thread: Mocking Database Access - unexpected invocation

Re: Mocking Database Access - unexpected invocation

by Winfried :: Rate this Message:

Reply to Author | View in Thread

Yes, the default behaviour is to require an object that is equal to the
one you specify in the expectations.  You should try:

oneOf(mockDBUser).getUser(with(any(DatabaseQueryBean.class)), with(any([whatever class your transactions are].class)));

That worked, Thanks a lot Jules

 « Return to Thread: Mocking Database Access - unexpected invocation