[improve][test] Upgrade Mockito to 5.23.0#25667
Merged
Merged
Conversation
dao-jun
approved these changes
May 4, 2026
nodece
approved these changes
May 4, 2026
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
May 6, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Pulsar relies on Mockito for unit testing across many modules. Since Mockito remains an actively used and integral test dependency, it should be kept up to date so that the project benefits from upstream bug fixes, JDK compatibility improvements, and reduced security/maintenance risk caused by drifting behind on widely-used libraries.
This PR bumps Mockito from
5.19.0to5.23.0, the current latest release.Notable changes between 5.19.0 and 5.23.0 (per https://github.com/mockito/mockito/releases)
StackOverflowErrorwithAbstractListafter usingmockSingleton; markMockito.whenparameters@Nullable; (Android-only breaking change replacing themockito-androidmock-maker — does not affect Pulsar, which only consumesmockito-core).UUID.classcorruption under JDK 25; add core API to enable Kotlin singleton mocking.WeakReferencewith the inline mock maker (fixesStackOverflowError); support primitives inGenericArrayReturnType(fixes AndroidClassNotFoundExceptionfor primitive arrays).The Mockito 5.23.0 transitive dependency on
byte-buddy(1.17.7) already matches the version pinned in Pulsar'sgradle/libs.versions.toml, andobjenesisremains at 3.3 (unchanged from 5.19.0), so no other version updates are required.Modifications
mockitoversion ingradle/libs.versions.tomlfrom5.19.0to5.23.0.Verifying this change
This change is a trivial dependency upgrade without functional code changes. It is covered by the existing test suite — verified locally with:
./gradlew assemble— BUILD SUCCESSFUL./gradlew testClasses— BUILD SUCCESSFUL (all test sources compile against Mockito 5.23.0)./gradlew spotlessCheck checkstyleMain checkstyleTest— BUILD SUCCESSFULDoes this pull request potentially affect one of the following parts: