- Make sure your default java is of 8 version.
- Run
./gradlew clean build
java -jar build/libs/money-transfer-1.0.0.jar
POST /accounts HTTP/1.1
Host: localhost:8080
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 21
{
"id": 1,
"balance": 0
}
GET /accounts?accountId=1 HTTP/1.1
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 21
{
"id": 1,
"balance": 0
}
GET /accounts HTTP/1.1
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 44
[
{
"id": 1,
"balance": 0
},
{
"id": 2,
"balance": 0
}
]
PUT /accounts/topup?accountId=1&amount=1000
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 24
{
"id": 1,
"balance": 1000
}
PUT /accounts/withdraw?accountId=1&amount=100
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 23
{
"id": 1,
"balance": 900
}
PUT /accounts/transfer?from=1&to=2&amount=100
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 66
{
"source": {
"id": 1,
"balance": 800
},
"target": {
"id": 2,
"balance": 100
}
}