Mock static method in JUnit 5 using Mockito
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 … Read more