You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@livy.apache.org by "Gyorgy Gal (Jira)" <ji...@apache.org> on 2026/10/05 19:54:00 UTC
[jira] [Resolved] (LIVY-1089) Upgrade Mockito from 1.10.19 to 3.4.6 (mockito-all -> mockito-core)
[ https://issues.apache.org/jira/browse/LIVY-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gyorgy Gal resolved LIVY-1089.
------------------------------
Fix Version/s: 1.0.0
Resolution: Fixed
PR: https://github.com/apache/livy/pull/565
> Upgrade Mockito from 1.10.19 to 3.4.6 (mockito-all -> mockito-core)
> -------------------------------------------------------------------
>
> Key: LIVY-1089
> URL: https://issues.apache.org/jira/browse/LIVY-1089
> Project: Livy
> Issue Type: Improvement
> Affects Versions: 1.0.0
> Reporter: Gabor Roczei
> Assignee: Gabor Roczei
> Priority: Major
> Fix For: 1.0.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> h3. Problem
> {{mockito-all:1.10.19}} is an uber-jar that bundles Hamcrest 1.x. This conflicts with the Hamcrest 2.x pulled in by the ScalaTest 3.2.9 / {{org.scalatestplus:mockito-3-4}} binding introduced in LIVY-1066: the bundled {{LocalizedMatcher}} does not implement {{Matcher.describeMismatch(Object, Description)}} and fails to compile.
> h3. Change
> Switch to {{mockito-core}} (which does not bundle Hamcrest) and align the version with the {{mockito-3-4_2.13:3.2.9.0}} binding.
> * {{{}pom.xml{}}}: {{mockito-all}} -> {{{}mockito-core{}}}, version {{1.10.19}} -> {{3.4.6}}
> * Replace removed {{org.mockito.Matchers}} with {{org.mockito.ArgumentMatchers}}
> * Replace removed {{anyObject()}} with {{any()}}
> * Rewrite custom {{ArgumentMatcher[Path]}} instances to the Mockito 2+ shape ({{{}matches(T){}}} instead of {{{}matches(Object){}}}; drop the removed {{{}describeTo{}}}), dropping the now-unused Hamcrest {{Description}} and internal {{Equals}} imports
> h3. Note
> In Mockito 3.4.6 {{org.mockito.Matchers}} still exists only as a deprecated subclass of {{ArgumentMatchers}} and declares no members of its own, so Scala cannot import its inherited statics (e.g. {{import org.mockito.Matchers.any}} fails to compile). All Scala specs must import from {{org.mockito.ArgumentMatchers}} directly.
> h3. Affected specs
> HttpClientSpec, ScalaJobHandleTest, BatchSessionSpec, InteractiveSessionServletSpec, InteractiveSessionSpec, FileSystemStateStoreSpec, SparkYarnAppSpec.
> This is part of the Spark 4 / Scala 2.13 enablement work (follow-up to LIVY-1066).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)