#!/usr/bin/env bash # Declaring @ExceptionHandler(MethodArgumentNotValidException.class) in a subclass of # ResponseEntityExceptionHandler. -> docs/output/ambiguous-handler.txt set -uo pipefail source "$(dirname "$0")/env.sh" "$MODULE_DIR/scripts/stop.sh" timeout 60 java -jar "$JAR" --spring.profiles.active=ambiguous --server.port="$PORT" > "$LOG" 2>&1 code=$? { echo "# Profile: ambiguous (exit code $code)" echo grep -v 'Picked up JAVA_TOOL_OPTIONS' "$LOG" | grep -E '^Caused by: java.lang.IllegalStateException: Ambiguous' | head -1 \ | sed -e 's/: {/:\n {/' -e 's/, public/,\n public/' } > "$OUT/ambiguous-handler.txt" cat "$OUT/ambiguous-handler.txt"