Skip to content

Upgrade Byte Buddy along with Mockito where a BOM manages it - #1278

Merged
timtebeek merged 1 commit into
mainfrom
ken/mockito-align-byte-buddy
Nov 3, 2026
Merged

timtebeek merged 1 commit into
mainfrom
ken/mockito-align-byte-buddy

Conversation

@krlittle

@krlittle krlittle commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What's changed?

New UpgradeByteBuddyForMockito3, UpgradeByteBuddyForMockito4 and UpgradeByteBuddyForMockito5, called from the matching Mockito upgrades. When mockito-core resolves to that major and Byte Buddy resolves to something older than that Mockito needs, byte-buddy and byte-buddy-agent are bumped with UpgradeTransitiveDependencyVersion.

What's your motivation?

With a Spring Boot 2 parent Byte Buddy is managed (1.9.13 for 2.1), so taking Mockito past what the BOM manages leaves every mock failing with

Caused by: java.lang.ClassNotFoundException: net.bytebuddy.utility.GraalImageCode

Hit this on sflpro/notifier after migrating it from EasyMock.

Anything in particular you'd like reviewers to focus on?

Both checks are DependencyInsight preconditions, so they see the dependencies after the Mockito upgrade earlier in the same run. Without the Byte Buddy check it also pinned 1.17.8 over the 1.17.7 that Mockito 5.24 already brings, in projects that didn't need anything.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Nov 2, 2026
@krlittle krlittle changed the title Upgrade a transitive Byte Buddy that is too old for the Mockito upgraded to Upgrade Byte Buddy along with Mockito where a BOM manages it Nov 2, 2026
@timtebeek
timtebeek merged commit 30064c0 into main Nov 3, 2026
1 check passed
@timtebeek
timtebeek deleted the ken/mockito-align-byte-buddy branch November 3, 2026 12:48
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants