You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Elliotte Rusty Harold <el...@ibiblio.org> on 2020/04/27 14:13:29 UTC
Prefer Mockito?
Anyone have an opinion on recommending Mockito as our preferred mocking
library?
https://github.com/apache/maven-site/pull/158/files
This doesn't require us to port old unit tests, though we can. Right now we
have a mix of Mockito, JMock, PowerMock, and EasyMock spread out across the
plugins.
--
Elliotte Rusty Harold
elharo@ibiblio.org
Re: Prefer Mockito?
Posted by Karl Heinz Marbaise <kh...@gmx.de>.
On 27.04.20 16:54, John Patrick wrote:
> Just did comment regarding typo.
>
> I also advocate Mockito, so also would be recommending that.
>
> It appeared Mockito supported junit v5 earlier than others and
> compared to previous versions remove boiler plate setup. Or I missed
> those other frameworks supporting junit v5.
> PowerMock might be agued that is supports static, but most of the code
> i've reviewed just highlight most developer mock static
> classes/methods incorrectly and end up just verifying the mock they
> create.
> Not touched/used JMock or EasyMock for about 10 years so no idea about them.
For me the need to use PowerMock is a hard smell in code base j
Mockito works for almost all cases ..also final classes working via
mockito-inline dependency...also good support via mockito extension for
JUnit Jupiter via @Mock, @InjectMock etc.
JMockit can help (very rare cases) if you need to mock things like
System.currentMillis or Date but that can be handled different most of
the times...
I would suggest to migrate everything which uses EasyMock, PowerMock in
particular and JMock ...to Mockito only ...
Kind regards
Karl Heinz Marbaise
>
> John
>
>
> On Mon, 27 Apr 2020 at 15:14, Elliotte Rusty Harold <el...@ibiblio.org> wrote:
>>
>> Anyone have an opinion on recommending Mockito as our preferred mocking
>> library?
>>
>> https://github.com/apache/maven-site/pull/158/files
>>
>> This doesn't require us to port old unit tests, though we can. Right now we
>> have a mix of Mockito, JMock, PowerMock, and EasyMock spread out across the
>> plugins.
>>
>> --
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Prefer Mockito?
Posted by John Patrick <nh...@gmail.com>.
Just did comment regarding typo.
I also advocate Mockito, so also would be recommending that.
It appeared Mockito supported junit v5 earlier than others and
compared to previous versions remove boiler plate setup. Or I missed
those other frameworks supporting junit v5.
PowerMock might be agued that is supports static, but most of the code
i've reviewed just highlight most developer mock static
classes/methods incorrectly and end up just verifying the mock they
create.
Not touched/used JMock or EasyMock for about 10 years so no idea about them.
John
On Mon, 27 Apr 2020 at 15:14, Elliotte Rusty Harold <el...@ibiblio.org> wrote:
>
> Anyone have an opinion on recommending Mockito as our preferred mocking
> library?
>
> https://github.com/apache/maven-site/pull/158/files
>
> This doesn't require us to port old unit tests, though we can. Right now we
> have a mix of Mockito, JMock, PowerMock, and EasyMock spread out across the
> plugins.
>
> --
> Elliotte Rusty Harold
> elharo@ibiblio.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Prefer Mockito?
Posted by Robert Scholte <rf...@apache.org>.
People are bad readers.
I'd suggest to spend some time to replace those frameworks with mockito (and powermock tests should be rewritten or removed, there should be no reason to use it).
Otherwise we'll get more easymock tests or no PRs at all as people don't know how to use easymock.
I've just removed it from maven-assembly-plugin.
Yes it takes some time, but at least there's again a better maintainable codebase.
Robert
On 27-4-2020 16:14:14, Elliotte Rusty Harold <el...@ibiblio.org> wrote:
Anyone have an opinion on recommending Mockito as our preferred mocking
library?
https://github.com/apache/maven-site/pull/158/files
This doesn't require us to port old unit tests, though we can. Right now we
have a mix of Mockito, JMock, PowerMock, and EasyMock spread out across the
plugins.
--
Elliotte Rusty Harold
elharo@ibiblio.org