Replace deprecated mockito-inline with mockito-core 5.18.0 - #196
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Replace deprecated mockito-inline with mockito-core 5.18.0#196devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
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
org.mockito:mockito-inlineis deprecated — since Mockito 5 the inline mock maker is the default inmockito-core, so the separate artifact is unnecessary. This drops it and pins Mockito to 5.18.0.Two non-obvious bits:
mockito.versionproperty override is what actually matters: Spring Boot 2.6.3's dependency management pins Mockito to 4.0.0, so it also dragsmockito-junit-jupiter(pulled in transitively byspring-boot-starter-test) to 4.0.0. Setting the property keepsmockito-coreandmockito-junit-jupiteron the same 5.18.0 line instead of a 5.x/4.x split.byte-buddy.versionis bumped to 1.17.6 to match what Mockito 5.18 expects.No test source changes were needed — the suite only uses standard
@MockBean/when/verifyAPIs, no removed Mockito 4 surface (initMocks,Matchers,verifyZeroInteractions) and no explicitMockMakerextension file that would need deleting.Verification
./gradlew clean test spotlessCheckon Java 11 (the version CI uses): BUILD SUCCESSFUL, 68 tests, 0 failures.Not addressed here (pre-existing on
main, unrelated to this change):jacocoTestCoverageVerificationfails at ~33% vs the 80% rule — CI runstest -x jacocoTestCoverageVerification.spotlessCheckcrashes under JDK 17 (google-java-formatneeds--add-exportsforjdk.compiler); it passes under Java 11.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/6a8bfa10f81b4c6f82cebd2818c392fc
Requested by: @mbatchelor81