The main objective of this project is to show how to test applications using JUnit5 and its features, specially how to perform Parameterized Tests.
If you want to know more about the testing methodologies applied in this project and why or when to use each one of them, please check this article on Medium that I wrote using this project as reference.
Since the goal of this project is target to the test classes the project domain itself was planned to be very simple and very understandable. That said, we have only two controllers one for User
context [GET and POST]
and another one for Task
context [GET and POST]
. This behaviour is propagated to the others layers as well.
- Go to the project root folder
- Run command
docker-compose up -d
to run PostgreSQL on Docker. - Run command
./gradlew migrateLocal
to run flyway migrations. - Run command
./gradlew clean build
to build the project. Tests are always executed in this step. - If you want to run only the tests you can run this command:
./gradlew :<module>:test
replace<module>
for eitherapi
orcore
depending on which layer you want to test. ./gradlew :api:test
|./gradlew :core:test
- To execute Pitest on the project:
./gradlew pitest
- To run the project api:
./gradlew :api:bootRun
Before you begin, you will need to have the following tools installed on your machine:
- Git.
- Docker.
- Java 11 Sdk.