--
You received this message because you are subscribed to the Google Groups "mockito" group.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
inside this method:
jtc.createTrigger(BROKER_ALIAS, TOPIC_NAME, DEST_TYPE, PACKAGE_NAME,
TRIGGER_NAME);
a call is made to a mocked "invoker" like so:
mockedInvoker.invoke(USER, PASSWORD, "wm.server.jms", "createJMSTrigger", data);
I'm interested in verifying this call is made and that the "data" is
correct. Unfortunately, the person who wrote the data class (which is
of type IData) didn't override equals. So what I need to do is
capture the value that is passed and manually inspect it.
So I tried this:
ArgumentCaptor<IData> argument = ArgumentCaptor.forClass(IData.class);
verify(invoker.invoke(eq(USER), eq(PASSWORD), eq("wm.server.jms"),
eq("createJMSTrigger"), argument.capture()));
But I get this error:
org.mockito.exceptions.misusing.NullInsteadOfMockException:
Argument passed to verify() should be a mock but is null!
Examples of correct verifications:
verify(mock).someMethod();
verify(mock, times(10)).someMethod();
verify(mock, atLeastOnce()).someMethod();
note that I verified "invoker" is not null (it is mocked). And
"argument" is not null.
ideas?