I'm about to write some tests for a few classes that have too many methods, along with a small number of methods that I'm going to have to mock, so I'm going to have to "spy" it. The annoying thing I see coming is that it looks like if I "spy" my class I'm going to have to write numerous "when(spied.method()).thenCallRealMethod()" calls, except for the small number of methods that I need to mock. I almost wish I could make it assume that it will call all real methods, and then specify the ones I want to mock.
--
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.
I'm about to write some tests for a few classes that have too many methods, along with a small number of methods that I'm going to have to mock, so I'm going to have to "spy" it. The annoying thing I see coming is that it looks like if I "spy" my class I'm going to have to write numerous "when(spied.method()).thenCallRealMethod()" calls, except for the small number of methods that I need to mock. I almost wish I could make it assume that it will call all real methods, and then specify the ones I want to mock.
Thanks. I got it working. Concerning standard practice, theory is often not reality.
Concerning standard practice, theory is often not reality.