Using Mockito 4.3.1 instead of Powermock

Viewed 505

I am trying to get rid of Powermock and mock my static classes with Mockito using version 4.3.1. I updated version in my dependencies. I updated my dependency as mockito-inline instead of mockito-core at my pom.xml. But I keep getting the following error. I am using IntelliJ, when I check File > Project Structure > Dependencies I still see mockito-core there but when I remove it I got bunch of "Cannot resolve symbol Mockito/@Mock" etc. errors. Do you have ideas about what should I do? Thanks!

The used MockMaker PowerMockMaker does not support the creation of static mocks

Mockito's inline mock maker supports static mocks based on the Instrumentation API.
You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.
Note that Mockito's inline mock maker is not supported on Android. 
0 Answers
Related