mockito: Mockito 5 lab (inline mock maker, static/construction mocking, captors, BDD, strict stubs)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cfo2K4u4rF18QsPXPFnytf
This commit is contained in:
2026-10-24 17:19:45 +00:00
co-authored by Claude Sonnet 5.5
commit 8fc8bc934f
38 changed files with 689 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Regenerates every file in mockito/output/.
set -euo pipefail
cd "$(dirname "$0")/.."
unset JAVA_TOOL_OPTIONS
# 1. The whole suite with Mockito loaded as a -javaagent (the recommended setup).
mvn -B -q clean test
# 2. The same single test WITHOUT the agent, to capture what a JDK 21+ prints when Mockito self-attaches.
mvn -B -Pno-agent test -Dtest=MockMakerTest 2>&1 \
| grep -E '^(Mockito is currently|WARNING: (A Java agent|If a serviceability|Dynamic loading))' \
| sed -E 's#\(/[^)]*/byte-buddy-agent-([0-9.]+)\.jar\)#(<local-repo>/byte-buddy-agent-\1.jar)#' \
> output/14-dynamic-agent-warning.txt
echo "done: $(ls output | wc -l) files in output/"