Your approach LGTM Vishes, and we need to ensure build stability and smoketests continue to pass as-is. It would be great if unit tests using powermock runner are refactored or supported/counted in the codecoverage.
Regards. ________________________________ From: Daan Hoogland <daan.hoogl...@gmail.com> Sent: Tuesday, June 6, 2023 18:18 To: dev@cloudstack.apache.org <dev@cloudstack.apache.org> Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock I like your approach Vishesh +1 from me On Tue, Jun 6, 2023 at 2:18 PM Vishesh Jindal <vishesh.jin...@shapeblue.com> wrote: > > Hi all, > > I am working on upgrading Mockito's version & phasing out powermock. For new > maven modules, I would request all to use Mockito's mockStatic instead of > Powermock. > > Why? > Powermock's last release was on Nov 2, 2020. The project seems to have been > abandoned. Powermock has compatibility issues with Mockito's latest version > as well. > > How? > The only usage for PowerMock I could see in code was for mocking static > methods. Since Mockito v3.4.0, it has the capability to mock static methods. > I plan to migrate tests to Mockito's mockStatic instead of PowerMock. This > will have to be done module by module and will take some time. > > I have prepared a PR here: https://github.com/apache/cloudstack/pull/7577 > > This PR upgrades mockito from v3.2.4 to v3.12.4 and removes the usage of > PowerMock from utils module. > > > Let me know if you have any questions/concerns. > > Regards, > Vishesh > > > > -- Daan