This project illustrates TDD & Clean Architecture implementation in Java, showing the Use Case Driven Development Approach.
We implement a Banking system with the following use cases:
- Open account
- Withdraw funds
- Deposit funds
- View account
- OpenJDK 17
- If you don't use Docker:
- If you prefer to use Docker:
To be able to run the tests (since some of the tests are dependent on the database - the integration tests), we then need to set the environment variables.
In IntelliJ, for the Tests in 'banking-kata.test'
configuration, you can copy this into the Environment variables
POSTGRES_URL=jdbc:postgresql://localhost:5432/banking_kata;POSTGRES_USER=postgres;POSTGRES_PASSWORD=admin
You need to have created the database, in the example I had created a database called banking_kata
.
Please update the environment variable values based on your local settings.
Environment Variables
$env:POSTGRES_URL='jdbc:postgresql://localhost:5432/banking_kata'
$env:POSTGRES_USER='postgres'
$env:POSTGRES_PASSWORD='admin'
Running build with automated tests:
./gradlew build
Running JaCoCo code coverage:
./gradlew jacocoTestReport
Running PIT mutation testing:
./gradlew pitest
See the build\reports
directory for the generated reports for test results, code coverage and mutation testing.
Reports:
- build\reports\tests
- build\reports\jacoco
- build\reports\pitest
If you'd like to contribute, see instructions here https://github.com/valentinacupac/banking-kata-java/blob/main/CONTRIBUTING.md