Skip to content

Upgrade mockito-inline 4.0.0 -> 5.2.0 - #208

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785417525-mockito-inline-upgrade
Open

Upgrade mockito-inline 4.0.0 -> 5.2.0#208
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785417525-mockito-inline-upgrade

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Bumps org.mockito:mockito-inline to 5.2.0 (the last published release of that artifact).

The version bump alone doesn't work: Spring Boot 2.6.3's BOM pins mockito-core/mockito-junit-jupiter to 4.0.0 and byte-buddy to 1.11.22. Mixing inline 5.2.0 with core 4.0.0 compiles but every mock-using test blows up at runtime with MockitoInitializationException -> NoClassDefFoundError (SubclassInjectionLoader) because Mockito 5 requires Byte Buddy 1.14.x. So the BOM properties are overridden alongside the dependency:

ext['mockito.version']    = '5.2.0'   // also moves mockito-core + mockito-junit-jupiter
ext['byte-buddy.version'] = '1.14.1'  // required by mockito 5.2.0
ext['objenesis.version']  = '3.3'

No test source changes were needed — the suite only uses Mockito.when/verify, ArgumentMatchers, and Spring's @MockBean, none of which changed in Mockito 5. There is no initMocks/verifyZeroInteractions/PowerMock usage to migrate.

Note that since Mockito 5.0 the inline mock maker is the default in mockito-core, so mockito-inline is now an empty shim kept only for compatibility; a follow-up could drop the dependency entirely.

Verification

./gradlew clean test spotlessCheck on JDK 11 (matching CI): 68 tests, 0 failures; formatting clean. ./gradlew build -x test also passes with the Byte Buddy bump.

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

@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

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.

0 participants