Companion code for "Global Exception Handling with ProblemDetail (RFC 9457) in Spring Boot 4". Thirteen failures under five handling setups (Boot defaults, the Boot flag, a ResponseEntityExceptionHandler advice, advice plus an ErrorController, a catch-all ordered first), validation errors, i18n, content negotiation, Security's 401/403, silent 500s and decoding on the client. 16 tests pin the behaviour. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01C3TETMrqVUWeFkNtz3Jbo3
16 lines
585 B
Bash
16 lines
585 B
Bash
#!/usr/bin/env bash
|
|
# Which @ControllerAdvice beans exist, in consultation order. -> docs/output/advice-order.txt
|
|
set -uo pipefail
|
|
source "$(dirname "$0")/env.sh"
|
|
{
|
|
for profile in "" boot-flag advice "boot-flag,advice" catchall-first; do
|
|
"$MODULE_DIR/scripts/run.sh" "$profile" || exit 1
|
|
echo "## profiles: ${profile:-<none>}"
|
|
curl -s "$BASE/diag/advice" | python3 -c 'import json,sys
|
|
for r in json.load(sys.stdin): print(" order %-12s %s" % (r["order"], r["bean"]))
|
|
' ; echo
|
|
done
|
|
} > "$OUT/advice-order.txt"
|
|
"$MODULE_DIR/scripts/stop.sh"
|
|
cat "$OUT/advice-order.txt"
|