Skip to content

UID2-8117: Load Mockito as a javaagent in surefire (Mockito 5.23.0) - #2787

Merged
sunnywu merged 1 commit into
mainfrom
syw-UID2-8117-mockito-javaagent-argline
Oct 21, 2026
Merged

sunnywu merged 1 commit into
mainfrom
syw-UID2-8117-mockito-javaagent-argline

Conversation

@sunnywu

@sunnywu sunnywu commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Loads Mockito as a javaagent in surefire so it no longer self-attaches to the JVM at test time.

  • Bump mockito-core (5.14.1) and mockito-junit-jupiter (5.12.0) to 5.23.0 (agent support requires Mockito 5.14+).
  • Add maven-dependency-plugin 3.8.1 with the properties goal so ${org.mockito:mockito-core:jar} resolves.
  • Surefire argLine: ${argLine} -Dfile.encoding=... becomes @{argLine} -Dfile.encoding=... -javaagent:${org.mockito:mockito-core:jar} (late evaluation preserves the JaCoCo agent).

Tests: 761 pass locally on JDK 21.

🤖 Generated with Claude Code

…23.0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Ticket: UID2-8117
Branch: syw-UID2-8117-mockito-javaagent-argline
@sunnywu
sunnywu merged commit 2cdc330 into main Oct 21, 2026
8 of 10 checks passed
@sunnywu
sunnywu deleted the syw-UID2-8117-mockito-javaagent-argline branch October 21, 2026 01:59
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.

2 participants