Replace deprecated mockito-inline 4.0.0 with mockito-core 5.18.0 - #200
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Replace deprecated mockito-inline 4.0.0 with mockito-core 5.18.0#200devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Override BOM-managed mockito.version and byte-buddy.version so all mockito artifacts resolve to 5.18.0.
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Replaces the deprecated
org.mockito:mockito-inlineartifact withorg.mockito:mockito-core5.18.0.mockito-inlinewas deprecated because the inline mock maker became the default mock maker insidemockito-core5.x, so this is an artifact removal plus a version bump, not a re-add. Zero source changes were needed.Coordinate diff
5.18.0 is the newest stable
mockito-coreon Maven Central (published 2025-05-20; no newer non-prerelease exists). Mockito 5 requires Java 11+, which this project already targets (sourceCompatibility = 11).Why the
extoverridesThe Spring Boot 2.6.3 BOM manages
mockito.version(4.0.0) andbyte-buddy.version(1.11.x). Bumping only thetestImplementationline leavesmockito-core/mockito-junit-jupiterpulled transitively viaspring-boot-starter-test,mybatis-spring-boot-starter-testandgraphql-dgs-platform-dependenciespinned at 4.0.0 / 3.3.3 — a split classpath. Overriding the managed properties moves the whole family in lockstep.byte-buddy1.17.5 is whatmockito-core:5.18.0's POM requires; the BOM-managed 1.11.x is too old for it.Nothing else in
build.gradlewas touched (no Spring Boot, dependency-management, DGS or other dependency changes).dependencyInsightevidence — the new version actually resolves./gradlew dependencyInsight --configuration testRuntimeClasspath --dependency org.mockito./gradlew dependencyInsight --configuration testRuntimeClasspath --dependency net.bytebuddyNo
mockito-inlineremains ontestRuntimeClasspath, and there is exactly one version of every Mockito artifact.API migration summary
No source changes needed. Every Mockito usage in the suite is
org.mockito.Mockito.when/verifyplus Spring's@MockBean— all unchanged between 4.x and 5.x. There is nosrc/test/resources/mockito-extensions/directory (the inline mock maker is on by default in 5.x anyway), and there are nomockStatic/MockedStatic/RETURNS_DEEP_STUBS/ final-class-mocking usages that Mockito 5 would have tightened. No stale references to the old coordinate exist elsewhere in the repo (docs, CI workflows).Gate
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 ./gradlew clean test spotlessCheck -x jacocoTestCoverageVerification(JDK 11, matching CI), from a clean tree:main(3037fa5)Same test count, zero new failures,
spotlessCheckgreen (spotlessApplyrun before committing).Pre-existing on base, not addressed here
jacocoTestCoverageVerificationfails onmainat ~0.33 instruction coverage against the 0.80 rule inbuild.gradle. CI excludes it (./gradlew clean test -x jacocoTestCoverageVerification) and so does the gate above. The threshold was not lowered and no tests were added to game coverage.src/test/java/io/spring/selenium) run under the separateseleniumTestTestNG task and are excluded from thetesttask; they are unaffected by this change and are not part of the gate.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/a59397ae074d418d8de1ad876696d98d
Requested by: @mbatchelor81