Hello.
I've googled about this, but didn't find anything relevant. I've got something like this:
Object obj = getObject();
Mockeable mock= Mockito.mock(Mockeable.class);
Mockito.when(mock.mymethod(obj )).thenReturn(null);
Testeable obj = new Testeable();
obj.setMockeable(mock);
command.runtestmethod();
Now, I want to verify that mymethod(Object o)
, which is called inside runtestmethod()
, was called with the Object o
, not any other. But I always pass the test, whatever I put on the verification, for example, with:
Mockito.verify(mock.mymethod(Mockito.eq(obj)));
or
Mockito.verify(mock.mymethod(Mockito.eq(null)));
or
Mockito.verify(mock.mymethod(Mockito.eq("something_else")));
I always pass the test. How can I accomplish that verification (if possible)?
Thank you.