This application is built using Java, Maven, Spring boot, Spring data JPA and MongoDB.
Steps to setup the project
- Clone the project.
- Import project into IDE and build.
- You should have MongoDB configured in your local system and running.
- Update the project with all dependencies using (mvn clean install).
- Run project as spring application.
- Use postman or ARC or soup UI for testing.
{
"accountNumber":123456789,
"pin":1234
}
{
"accountNumber": 123456789,
"balance": 800.0,
"denomination": null,
"message": "Success!"
}
Trying to check balance with wrong pin
{
"accountNumber": 123456789,
"pin": 123
}
{
"errorMessage": "Invalid Account Number or Pin",
"requestedURI": "/api/accountBalance"
}
{
"accountNumber": 123456789,
"pin": 1234,
"withdrawAmount": 15
}
{
"accountNumber": 123456789,
"balance": 770.0,
"denomination": {
"fives": 1,
"tens": 1,
"twenties": 0,
"fifties": 0
},
"message": "Success!"
}
Trying to dispense money greater than balance amount in the account
{
"accountNumber": 123456789,
"pin": 1234,
"withdrawAmount": 800
}
{
"errorMessage": "Don't have enough funds in your Account",
"requestedURI": "/api/withdraw"
}
When we don't have enough money in ATM
{
"accountNumber": 123456789,
"pin": 1234,
"withdrawAmount": 800
}
{
"errorMessage": "Don't have enough funds in ATM machine, Sorry! ",
"requestedURI": "/api/withdraw"
}
When Entered amount is Invalid
{
"accountNumber": 123456789,
"pin": 1234,
"withdrawAmount": 801
}
{
"errorMessage": "Please enter the amount in multiples of 5 or 10",
"requestedURI": "/api/withdraw"
}
When entered amount is low
{
"accountNumber": 123456789,
"pin": 1234,
"withdrawAmount": 0
}
{
"errorMessage": "Entered Balance is too low",
"requestedURI": "/api/withdraw"
}