Junit5 mock a static method
问题 I want to mock a static method in junit5. But unfortunately, Junit5 does'nt support Powermockito. Is there any other methods to achieve the same other than reverting back to Junit4 回答1: Short answer no, as PowerMockito team is done with their work and waiting for JUnit team for extension and discussing here a lot. With some overhead you can: As JUnit5 provides support running legacy JUnit4, and there you can use PowerMockito. So you can create tests in Junit4 for these cases: Sample project