Whenever possible we should avoid mocking static methods, as mostly this is a sign of badly designed code. But if it is really needed (eg. in some legacy code), we may use the Mockito.mockStatic instead (v3.4.+).
Another reason is that PowerMock fails on recent Java versions
Whenever possible we should avoid mocking static methods, as mostly this is a sign of badly designed code. But if it is really needed (eg. in some legacy code), we may use the
Mockito.mockStaticinstead (v3.4.+).Another reason is that PowerMock fails on recent Java versions