This is the starter project for the Customer Transactions exercise.
The first thing you should do after cloning the repository is:
./mvnw clean testmvnw.cmd clean testThe sample test should pass before you begin implementing the exercise.
- Java 17
- Spring Boot
- Maven wrapper
- Spring Web
- Spring Data JPA
- H2 embedded database
- JUnit / Spring Boot Test
- A sample REST endpoint:
GET /api/sample - A sample test that loads the Spring context
Implement these four operations:
- Create transaction
- Get transaction
- Update transaction status
- Get all transactions for a customer
You may change the surrounding design if you believe your solution is better.
Every transaction contains:
- Transaction ID
- Customer ID
- Amount
- Currency
- Transaction Type
- Transaction Status
Define what makes a transaction valid. At minimum, consider:
- Transaction ID
- Customer ID
- Amount
- Currency
- Transaction type
- Initial status
Also explain any business validation you add beyond the annotations already supplied.
TODO
Example:
TODO
TODO
TODO
Example:
TODO
TODO
Add at least four meaningful tests.
Your tests should cover more than just application startup.
You decide exactly which tests provide the best coverage.