igor.wojda
02/02/2017, 6:43 PMorg.mockito.exceptions.base.MockitoException:
Cannot mock/spy class com.testclient.SomeApi
Mockito cannot mock/spy following:
- final classes
- anonymous classes
- primitive types
So the class is final - Yes. I could open it by adding open modifier but this does not feel like proper way of doing it (since I need this only for testing/mocking purpose). I found a way to open it for local tests using mock-maker-inline plugin, but it does not work for android instrumentation tests. Is there any way to automatically open all classes for purpose of android instrumentation testing so Mockito can create mocks properly?