As always, I tend to believe that mocks show what's wrong in a design. I think, in this case, that you might be better off if your objects are immutable (your importQueries() method might return a list of a ids instead, for example).
If the problem is that importQueries() does not belong to you (preventing you from getting it to work as I suggest), then you should consider providing an intermediate class that works do that. This is, I believe, the approach suggested in "Growing Object Oriented Software", a strongly recommended read.
Remember, you are supposed to use mocks to drive your design, not to patch things up after the design has happened
If you do not wish to change your code, then check out Mockito's Answer:
when(importService.importQueries()).then answer(new Answer(){…})
Eric
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mockito+u...@googlegroups.com.
To post to this group, send email to moc...@googlegroups.com.
Visit this group at http://groups.google.com/group/mockito.
For more options, visit https://groups.google.com/groups/opt_out.