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
21 lines
979 B
Bash
21 lines
979 B
Bash
#!/usr/bin/env bash
|
|
# Start the application with the given profiles (comma-separated, may be empty) and wait until it
|
|
# answers. Any instance started by a previous run is stopped first, by PID file - never by
|
|
# pattern-matching the process list, which can match (and kill) the calling shell.
|
|
# ./scripts/run.sh advice
|
|
# ./scripts/run.sh "" # Spring Boot defaults
|
|
set -euo pipefail
|
|
source "$(dirname "$0")/env.sh"
|
|
"$MODULE_DIR/scripts/stop.sh"
|
|
PROFILES="${1:-}"
|
|
[ -f "$JAR" ] || (cd "$MODULE_DIR" && mvn -q -DskipTests package)
|
|
nohup java -jar "$JAR" --server.port="$PORT" ${PROFILES:+--spring.profiles.active=$PROFILES} ${EXTRA_ARGS:-} \
|
|
> "$LOG" 2>&1 < /dev/null &
|
|
echo $! > "$PIDFILE"
|
|
for _ in $(seq 1 60); do
|
|
if curl -s -o /dev/null "$BASE/orders/1"; then exit 0; fi
|
|
if ! kill -0 "$(cat "$PIDFILE")" 2>/dev/null; then echo "application exited - see $LOG" >&2; exit 1; fi
|
|
sleep 0.5
|
|
done
|
|
echo "application did not start within 30s - see $LOG" >&2; exit 1
|