Skip to content
Code examples for effective enterprise testing
Java Gherkin Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
barista
coffee-shop-st
coffee-shop
presentation updated slides Aug 29, 2019
.gitignore updated to Jakarta; updated to JDK 12; restored ITs Sep 28, 2019
LICENSE
README.adoc updated readme, scripts, and minor changes Aug 29, 2019
local-build.sh updated readme, scripts, and minor changes Aug 29, 2019
local-run-env.sh updated contents & environment scripts Aug 29, 2019
systemtest-run-env.sh updated readme & scripts Aug 29, 2019

README.adoc

Effective Testing & Test Automation

Some projects for my presentations on effective enterprise testing.

The example projects contain a coffee-shop application, which uses the coffee-shop-db database, and a barista application.

Running

You run the environment, containing the coffee-shop, barista applications and the coffee-shop-db using Docker containers.

In order to run the Docker containers locally, you need to create a Docker network first:
docker network create --subnet=192.168.42.0/24 dkrnet

Then you can build the coffee-shop project and run the environment as follows:

./local-build.sh
./local-run-env.sh

You can access the coffee-shop application using HTTP, after the applications have been started:

curl localhost:8001/coffee-shop/resources/
curl localhost:8001/coffee-shop/resources/orders

You create new coffee orders by POST-ing the JSON representation of a new order:

curl localhost:8001/coffee-shop/resources/orders -i \
  -XPOST \
  -H 'Content-Type: application/json' \
  -d '{"type":"Espresso","origin":"Colombia"}'

INFO: To stop and clean up the containers again, run: docker stop coffee-shop barista coffee-shop-db

Running the tests

You run the non-integration tests by executing mvn clean test, or mvn clean package (any goal that executes Maven’s test phase).

You run the integration tests by executing mvn test-compile failsafe:integration-test failsafe:verify.

You can run the systems tests either in a Kubernetes environment or using plain Docker containers.

System tests on local Docker containers

You run the system test environment by executing:

./systemtest-run-env.sh

This starts up the coffee-shop application, the coffee-shop-db database, and a barista mock server.

The system tests contained in coffee-shop-st/ will run against that deployed environment:

cd coffee-shop-st/
mvn clean test

INFO: To stop and clean up the system test containers again, run: docker stop coffee-shop barista coffee-shop-db

You can’t perform that action at this time.