Skip to content

Replace deprecated mockito-inline with mockito-core 5.18.0 - #196

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785169911-mockito5-upgrade
Open

Replace deprecated mockito-inline with mockito-core 5.18.0#196
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785169911-mockito5-upgrade

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 27, 2026

Copy link
Copy Markdown

Summary

org.mockito:mockito-inline is deprecated — since Mockito 5 the inline mock maker is the default in mockito-core, so the separate artifact is unnecessary. This drops it and pins Mockito to 5.18.0.

+ext['mockito.version'] = '5.18.0'
+ext['byte-buddy.version'] = '1.17.6'
-testImplementation 'org.mockito:mockito-inline:4.0.0'
+testImplementation 'org.mockito:mockito-core'

Two non-obvious bits:

  • The mockito.version property override is what actually matters: Spring Boot 2.6.3's dependency management pins Mockito to 4.0.0, so it also drags mockito-junit-jupiter (pulled in transitively by spring-boot-starter-test) to 4.0.0. Setting the property keeps mockito-core and mockito-junit-jupiter on the same 5.18.0 line instead of a 5.x/4.x split.
  • Boot 2.6.3 manages byte-buddy at 1.11.22, which is too old for Mockito 5.18; byte-buddy.version is 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/verify APIs, no removed Mockito 4 surface (initMocks, Matchers, verifyZeroInteractions) and no explicit MockMaker extension file that would need deleting.

Verification

./gradlew clean test spotlessCheck on Java 11 (the version CI uses): BUILD SUCCESSFUL, 68 tests, 0 failures.

Not addressed here (pre-existing on main, unrelated to this change):

  • jacocoTestCoverageVerification fails at ~33% vs the 80% rule — CI runs test -x jacocoTestCoverageVerification.
  • spotlessCheck crashes under JDK 17 (google-java-format needs --add-exports for jdk.compiler); it passes under Java 11.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/6a8bfa10f81b4c6f82cebd2818c392fc
Requested by: @mbatchelor81


Open in Devin Review

@mbatchelor81 mbatchelor81 self-assigned this Jul 27, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant