Product delivery tests

Event-driven application uses React, reactive Spring Boot WebFlux, R2DBC, MySQL and Liquibase

Status: IN PROGRESS

if [[ "" != `docker ps -aq` ]] ; then docker rm -f -v `docker ps -aq` ; fi

docker run -d --rm --name mysql --platform=linux/x86_64 \
  --health-cmd='mysqladmin ping -h 127.0.0.1 -u $MYSQL_USER --password=$MYSQL_PASSWORD || exit 1' \
  --health-start-period=1s --health-retries=1111 --health-interval=1s --health-timeout=5s \
  -e MYSQL_ROOT_PASSWORD=app-password -e MYSQL_DATABASE=app-database \
  -e MYSQL_USER=app-user -e MYSQL_PASSWORD=app-password \
  -p 3306:3306 \
  mysql:8.0.30

while [[ $(docker ps -n 1 -q -f health=healthy -f status=running | wc -l) -lt 1 ]] ; do
  sleep 3 ; echo -n '.'
done

sleep 15; echo 'MySQL is ready.'

./mvnw -f app clean compile spring-boot:run

http --ignore-stdin post :8080/api/v1/delivery budget=50 notes='Pick 2 pizzas and deliver to customer'
http --ignore-stdin  get :8080/api/v1/delivery
http --ignore-stdin  put :8080/api/v1/delivery/1/created
http --ignore-stdin  put :8080/api/v1/delivery/1/cancelled

./mvnw -f app spring-boot:stop
docker stop mysql

Links

GitHub

View Github