testing uses of Injector.get with mockito

13 May
2020
13 May
'20
5:15 p.m.
We have quite a few occasions when Injector.get(SomeClass.class) is used inside command. Given that mockito can't mock static methods and power mock is not used, I wonder what one should do when these usages have to be mocked in unit tests. Funny enough, workarounds for this usage in my specific case include mocking constructor (unsupported by mockito) and mocking superclass method (unsupported by mockito). Also, why not to @Inject these instances in the first place? Thanks, Fedor
1942
Age (days ago)
1942
Last active (days ago)
0 comments
1 participants
participants (1)
-
Fedor Gavrilov