#!/usr/bin/env bash # A transcript of the service's own endpoints, so the reader knows what the training run's traffic is. source "$(dirname "$0")/lib.sh" start_app "$WORK/ext" "$WORK/sample.log" "$JDK25/bin/java" -jar app.jar --server.port=$PORT wait_ready || { echo "did not start"; exit 1; } show() { # print the command the way a shell would need it typed, then run it printf '$'; for a in "$@"; do case $a in *[' {}"']*) printf " '%s'" "$a";; *) printf ' %s' "$a";; esac; done; echo "$@" -s -w ' [HTTP %{http_code}]\n' } show curl "localhost:$PORT/ping" show curl -H 'Content-Type: application/json' -d "$BODY" "localhost:$PORT/orders" show curl "localhost:$PORT/orders/1" show curl -H 'Content-Type: application/json' -d '{"customer":"bad","sku":"x","quantity":0}' "localhost:$PORT/orders" show curl "localhost:$PORT/orders/99" show curl "localhost:$PORT/actuator/health" stop_app exit 0