#!/usr/bin/env bash # What a failing @Validated @ConfigurationProperties actually prints at startup. set -euo pipefail cd "$(dirname "$0")/.." source scripts/env.sh { echo "== startup with demo.validated.* deliberately out of range ==" echo "\$ java -jar $JAR --spring.profiles.active=badvalidation" echo java -jar "$JAR" --spring.profiles.active=badvalidation \ --spring.main.web-application-type=none 2>&1 | clean \ | sed -n '/APPLICATION FAILED TO START/,/^Update your application/p' echo echo echo "All four violations are reported at once, each with the file and line that supplied" echo "the value. The process refused to start rather than serving traffic with a pool size" echo "of 4000." echo echo "Note demo.validated.pool.size has no Origin line. It is a nested record reached" echo "through @Valid, and the binder tracks origins per bound property, not per constraint." } > docs/output/04-validation-failure.txt 2>&1 cat docs/output/04-validation-failure.txt