We've included the full sample project here for you to play with.
You'll need to have docker installed for this exercise. Run this to start up postgres:
./start-local-test-db.sh
Start Quarkus in dev mode
./mvnw quarkus:dev
keep this running in a separate terminal window throughout this exercise!
./mvnw test
Look at the tests, specifically:
TestcontainersEnvironment
ArticleResourceTest
TagEntityTest
Notice in the test log output how the TestContainers are starting up a docker postgres instance.
Write tests for Article entity and finish the TagEntity tests. Try writing some tests that exercise the relationship between Article and Tag entity objects.
Write some tests that fetch Article based on tag. Do you need to modify the TagResource to traverse the relationship?