Simple RESTful API for transfering money between two accounts.
- Spark Java
- JOOQ
- H2 as in-memory database
- Junit and Rest Assured
POST
/account - Creates an acccount- example request body
{ "balance": 100.01 }
GET
/account/<accountId> - returns an account with balancePOST
/account/<accountId>/transfer - transfers money from one account to another- example request body
{ "destinationAccountId" : "5fd25de2-3051-4e50-ade1-f9bfe4e6506e", "sourceAccountId": "11fa45c3-2ff1-46db-8073-2c1431441161", "amount": 200 }
GET
/account/<accountId>/transfer - returns all account made by an account
This service is using maven wrapper, it is not necessary to have maven in the execution environment.
./mvnw clean verify
- to run tests
./mvnw clean package
- creates executable jar
java -jar ./target/money-transfer-service-1.0-SNAPSHOT.jar
- Running the executable jar on default port(8090)
java -Dserver.port=8080 -jar ./target/money-transfer-service-1.0-SNAPSHOT.jar
- If default port, 8090 already in use then it can be changed with server.port