adoroszlai opened a new pull request, #5991:
URL: https://github.com/apache/ozone/pull/5991

   ## What changes were proposed in this pull request?
   
   Mockito 3 (or earlier) does not work with newer Java versions, e.g.:
   
   ```
   MockitoException: Could not modify all classes [class 
org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer, class 
java.lang.Object]
        at 
org.apache.hadoop.ozone.container.common.TestBlockDeletingService.mockDependencies(TestBlockDeletingService.java:590)
   ```
   
   Mockito v4 supports newer Java versions, v5 requires Java 11 or newer.  This 
PR upgrades to 4.11.0 (latest v4) and fixes 
[incompatibilities](https://github.com/mockito/mockito/releases/tag/v4.0.0).
   
   https://issues.apache.org/jira/browse/HDDS-6068
   
   ## How was this patch tested?
   
   Ran unit tests with Java 17.  (Some failed due to other errors, unrelated to 
Mockito, see HDDS-8246.)
   
   Example:
   
   ```
   $ JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 mvn -V -am -pl 
:hdds-container-service -Dtest='TestBlockDeletingService' clean test
   ...
   Java version: 17.0.9
   ...
   Tests run: 56, Failures: 0, Errors: 0, Skipped: 4, Time elapsed: 19.62 s -- 
in org.apache.hadoop.ozone.container.common.TestBlockDeletingService
   ```
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/7505611374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to