there is something what I don't understand:
I've got a mock-object:
private Session session;
which I initialize in the setUp-method:
session = mock(Session)
It's an Hibernate Session (org.hibernate.Session)
When I try to set a "when(...)" with matchers I'll receive an error
"'void' method not allowed here":
when(session.load(anyObject(),anyString())).thenReturn(a)
the same happens when I change the Matchers to:
when(session.load(any(A.class),eq("123"))).thenReturn(a);
I had a look on anyObject(), anyString() etc. they're all "non-void-
methods".
Also the session.load(...,...) isn't a "void-method".
Everything works great when I remove the matchers:
when(session.load(A.class, "123").thenReturn(a)
It's a little bit strange. Does anybody has an idea?
I'm using netbeans and fest-asserts.
yours
Marc
--
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.