Account API application is a spring boot based application used create, find and delete accounts.
- JDK 8
- MongoDB - install here: https://docs.mongodb.com/manual/administration/install-community/
The application comes packaged with a Mongo database. To import some test data run the following command from the root of the project:
mongoimport -d account-api -c accounts src/test/resources/test-data.json --jsonArray
To build the project execute the following command:
./gradlew build
Run the application by executing:
./gradlew bootRun
To run all unit tests execute the following command:
./gradlew test
To create an account:
POST
to the /accounts
endpoint:
{
"firstName" : "Amelia",
"secondName" : "Ephgrave",
"accountNumber" : "4324234"
}
To find all accounts:
GET
to the /accounts
endpoint:
To delete an account:
DELETE
to the /accounts/{$id}
endpoint using the id of the account to delete