A Simple simulation of money transfer between accounts via REST API
mvn clean test
mvn exec:java
POST http://localhost:4567/moneytfapp/accountusers
sample request:
{ "userName": "sunnydas", "firstName":"Sunny", "lastName": "Das", "emailAddress": "abc@def.com", "dob": "", "address": "" }
sample response
{ "id": 1, "firstName": "Sunny", "lastName": "Das", "emailAddress": "abdc@def.com", "userName": "sunnydas", "dob": "", "address": "" }
POST http://localhost:4567/moneytfapp/account
sample request:
{ "accountName": "sunny", "userId":"1", "branchCode": "BN01", "currencyCode": "INR", "balance": "100", "accountType": "savings" }
sample response:
{ "id": 1, "userId": 1, "branchCode": "BN01", "accountName": "sunny", "currencyCode": "INR", "balance": 100, "accountType": "savings" }
POST http://localhost:4567/moneytfapp/transfer
sample request:
{ "sourceAccountId" :"1", "targetAccountId": "2", "transferAmount": "10" }
sample response:
{ "sourceAccountId": 1, "targetAccountId": 2, "transferAmount": 10, "dateOfTransfer": "2019-09-25", "status": "SUCCESS" }
PUT http://localhost:4567/moneytfapp/account
sample request:
{ "accountName": "ramesh", "id": "2", "userId":"2", "branchCode": "BN01", "currencyCode": "INR", "balance": "300", "accountType": "savings" }
sample response:
{ "id": 2, "userId": 2, "branchCode": "BN01", "accountName": "ramesh", "currencyCode": "INR", "balance": 300, "accountType": "savings" }
GET http://localhost:4567/moneytfapp/account/1
sample response:
{ "id": 1, "userId": 1, "branchCode": "BN01", "accountName": "sunny", "currencyCode": "INR", "balance": 100, "accountType": "savings" }
GET http://localhost:4567/moneytfapp/accountusers/1
sample response:
{ "id": 1, "firstName": "Sunny", "lastName": "Das", "emailAddress": "abc@def", "userName": "sunnydas", "dob": "", "address": "" }
Spark H2 Jersey client Java 1.8