You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Vishesh Jindal <Vi...@shapeblue.com> on 2023/06/06 12:17:24 UTC
[DISCUSS] Upgrading Mockito & phasing out powermock
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
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Rohit Yadav <ro...@shapeblue.com>.
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 <da...@gmail.com>
Sent: Tuesday, June 6, 2023 18:18
To: dev@cloudstack.apache.org <de...@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
<Vi...@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
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Daan Hoogland <da...@gmail.com>.
I like your approach Vishesh +1 from me
On Tue, Jun 6, 2023 at 2:18 PM Vishesh Jindal
<Vi...@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
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Wei ZHOU <us...@gmail.com>.
Good job Vishesh !
-Wei
On Tue, 26 Sept 2023 at 13:51, Vishesh Jindal <Vi...@shapeblue.com>
wrote:
> Hi all,
>
> I wanted to update everyone that powermock is completely removed from main
> branch now. Thank you everyone for helping out on this.
>
> Regards,
> Vishesh
>
> ________________________________
> From: Kishan Kavala <Ki...@shapeblue.com>
> Sent: Friday, June 9, 2023 1:30 PM
> To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
> Subject: RE: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> +1
> Agree with the approach, Vishesh.
>
>
>
>
>
>
>
> -----Original Message-----
> From: Wei ZHOU <us...@gmail.com>
> Sent: Tuesday, June 6, 2023 8:11 PM
> To: dev@cloudstack.apache.org
> Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> lgtm. go ahead Vishesh.
>
> -Wei
>
>
> On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
> >
> >
> >
> >
> >
>
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Rohit Yadav <ro...@shapeblue.com>.
Good work Vishesh!
Regards.
________________________________
From: Nicolas Vazquez <Ni...@shapeblue.com>
Sent: Tuesday, September 26, 2023 20:23
To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Great work Vishesh, thanks!
Regards,
Nicolas Vazquez
From: Daan Hoogland <da...@gmail.com>
Date: Tuesday, 26 September 2023 at 11:15
To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
great, thanks you for your persistence and effort in general.
On Tue, Sep 26, 2023 at 1:51 PM Vishesh Jindal <Vi...@shapeblue.com>
wrote:
> Hi all,
>
> I wanted to update everyone that powermock is completely removed from main
> branch now. Thank you everyone for helping out on this.
>
> Regards,
> Vishesh
>
> ________________________________
> From: Kishan Kavala <Ki...@shapeblue.com>
> Sent: Friday, June 9, 2023 1:30 PM
> To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
> Subject: RE: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> +1
> Agree with the approach, Vishesh.
>
>
>
>
>
>
>
> -----Original Message-----
> From: Wei ZHOU <us...@gmail.com>
> Sent: Tuesday, June 6, 2023 8:11 PM
> To: dev@cloudstack.apache.org
> Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> lgtm. go ahead Vishesh.
>
> -Wei
>
>
> On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Nicolas Vazquez <Ni...@shapeblue.com>.
Great work Vishesh, thanks!
Regards,
Nicolas Vazquez
From: Daan Hoogland <da...@gmail.com>
Date: Tuesday, 26 September 2023 at 11:15
To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
great, thanks you for your persistence and effort in general.
On Tue, Sep 26, 2023 at 1:51 PM Vishesh Jindal <Vi...@shapeblue.com>
wrote:
> Hi all,
>
> I wanted to update everyone that powermock is completely removed from main
> branch now. Thank you everyone for helping out on this.
>
> Regards,
> Vishesh
>
> ________________________________
> From: Kishan Kavala <Ki...@shapeblue.com>
> Sent: Friday, June 9, 2023 1:30 PM
> To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
> Subject: RE: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> +1
> Agree with the approach, Vishesh.
>
>
>
>
>
>
>
> -----Original Message-----
> From: Wei ZHOU <us...@gmail.com>
> Sent: Tuesday, June 6, 2023 8:11 PM
> To: dev@cloudstack.apache.org
> Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> lgtm. go ahead Vishesh.
>
> -Wei
>
>
> On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Daan Hoogland <da...@gmail.com>.
great, thanks you for your persistence and effort in general.
On Tue, Sep 26, 2023 at 1:51 PM Vishesh Jindal <Vi...@shapeblue.com>
wrote:
> Hi all,
>
> I wanted to update everyone that powermock is completely removed from main
> branch now. Thank you everyone for helping out on this.
>
> Regards,
> Vishesh
>
> ________________________________
> From: Kishan Kavala <Ki...@shapeblue.com>
> Sent: Friday, June 9, 2023 1:30 PM
> To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
> Subject: RE: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> +1
> Agree with the approach, Vishesh.
>
>
>
>
>
>
>
> -----Original Message-----
> From: Wei ZHOU <us...@gmail.com>
> Sent: Tuesday, June 6, 2023 8:11 PM
> To: dev@cloudstack.apache.org
> Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
>
> lgtm. go ahead Vishesh.
>
> -Wei
>
>
> On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Vishesh Jindal <Vi...@shapeblue.com>.
Hi all,
I wanted to update everyone that powermock is completely removed from main branch now. Thank you everyone for helping out on this.
Regards,
Vishesh
________________________________
From: Kishan Kavala <Ki...@shapeblue.com>
Sent: Friday, June 9, 2023 1:30 PM
To: dev@cloudstack.apache.org <de...@cloudstack.apache.org>
Subject: RE: [DISCUSS] Upgrading Mockito & phasing out powermock
+1
Agree with the approach, Vishesh.
-----Original Message-----
From: Wei ZHOU <us...@gmail.com>
Sent: Tuesday, June 6, 2023 8:11 PM
To: dev@cloudstack.apache.org
Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
lgtm. go ahead Vishesh.
-Wei
On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
>
>
>
>
>
RE: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Kishan Kavala <Ki...@shapeblue.com>.
+1
Agree with the approach, Vishesh.
-----Original Message-----
From: Wei ZHOU <us...@gmail.com>
Sent: Tuesday, June 6, 2023 8:11 PM
To: dev@cloudstack.apache.org
Subject: Re: [DISCUSS] Upgrading Mockito & phasing out powermock
lgtm. go ahead Vishesh.
-Wei
On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
>
>
>
>
>
Re: [DISCUSS] Upgrading Mockito & phasing out powermock
Posted by Wei ZHOU <us...@gmail.com>.
lgtm. go ahead Vishesh.
-Wei
On Tue, 6 Jun 2023 at 14:17, Vishesh Jindal <Vi...@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
>
>
>
>
>