[ 
https://issues.apache.org/jira/browse/HADOOP-14178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16205621#comment-16205621
 ] 

Andras Bokor commented on HADOOP-14178:
---------------------------------------

The 607 javac warnings make sense:

* 385 because 
[Matchers|https://static.javadoc.io/org.mockito/mockito-core/2.10.0/org/mockito/Matchers.html]
 class has been deprecated. 
[ArgumentMatchers|https://static.javadoc.io/org.mockito/mockito-core/2.10.0/org/mockito/ArgumentMatchers.html]
 should be used instead.
* 169 because of new WhiteBox.java
* 6 because of org.mockito.runners.MockitoJUnitRunner was moved to 
org.mockito.junit.MockitoJUnitRunner.
* The rest 47 warnings are because of Java8's [Target 
Type|https://docs.oracle.com/javase/tutorial/java/generics/genTypeInference.html#target_types]
 feature. So in Mockito 2 any() can be used instead of anyObject, anyList 
insterad of anyListOf and so on.

So all the 607 warnings because API change in Mockito so nothing dangerous.

I think they can be fixed either with this JIRA or separate JIRA(s) it's up to 
you.



> Move Mockito up to version 2.x
> ------------------------------
>
>                 Key: HADOOP-14178
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14178
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: test
>    Affects Versions: 2.9.0
>            Reporter: Steve Loughran
>            Assignee: Akira Ajisaka
>         Attachments: HADOOP-14178.001.patch, HADOOP-14178.002.patch, 
> HADOOP-14178.003.patch, HADOOP-14178.004.patch
>
>
> I don't know when Hadoop picked up Mockito, but it has been frozen at 1.8.5 
> since the switch to maven in 2011. 
> Mockito is now at version 2.1, [with lots of Java 8 
> support|https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2]. 
> That' s not just defining actions as closures, but in supporting Optional 
> types, mocking methods in interfaces, etc. 
> It's only used for testing, and, *provided there aren't regressions*, cost of 
> upgrade is low. The good news: test tools usually come with good test 
> coverage. The bad: mockito does go deep into java bytecodes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to