You need to use mockito-inline
version 3.4.0
or higher and remove mockito-core
from your dependencies (mockito-inline
depends on mockito-core
so it will be retrieved automatically).
That way, you will be using mockito static mocking correctly, but it wouldn’t solve the exception that you posted.
To fix it, you need to remove all dependencies of powermock
as it conflicts with mockito
and causes this error
The used MockMaker PowerMockMaker does not support the creation of static mocks