forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-37719][BUILD] Remove the
-add-exports
compilation option int…
…roduced by SPARK-37070 ### What changes were proposed in this pull request? In order to enable the UTs in `mllib-local` and `mllib` to use `mockito` to mock `j.u.Random`, `-add-exports=java.base/jdk.internal.util.random=ALL-UNNAMED` compile option is added for Java 17 in SPARK-37070 . This pr do the following change to remove the `-add-exports` option: 1. Introduce test dependence of mockito-inline, the new test dependence used to specify the configuration of `mockito-extensions` 2. Upgrade org.scalatestplus:mockito from 3-4 to 3-12 and upgrade mockito from 3.4.x to 3.12.x ### Why are the changes needed? Find a way to let `mockito` can mock `j.u.Random` directly and remove `-add-exports` compile option for Java 17. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - Pass the Jenkins or GitHub Action - Manual test with Java 17.0.1 Use maven ``` mvn clean install -pl mllib-local -am -DskipTests mvn test -pl mllib-local mvn clean install -pl mllib -am -DskipTests mvn test -pl mllib ``` Use sbt ``` build/sbt mllib-local/test build/sbt mllib/test ``` There are no test failed related to ` org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: class java.util.Random.` without `-add-exports=java.base/jdk.internal.util.random=ALL-UNNAMED`, all test can be successful. Closes apache#34991 from LuciferYang/upgrade-mockito. Authored-by: yangjie01 <[email protected]> Signed-off-by: Sean Owen <[email protected]>
- Loading branch information
1 parent
4caface
commit 88c7b6a
Showing
6 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters