For Open API (Swagger) Documentation UI and the endpoints, open http://localhost:8080/swagger-ui/index.html after running the app.
The Postman Collection shared in the resources can be modified and used for testing the endpoints.
Tip
When running create Account
method on Postman, accountId
variable is automatically set using the following script. The other Postman methods e.g. credit Money To Account
uses the last created
accountId
if its value is not changed on the request body.
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("accountId", jsonData.data.id);
Note
All URIs are relative to http://localhost:8080/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
AccountCommandController | createAccount | POST /accounts | Creates a new account using the given request parameters |
AccountCommandController | creditMoneyToAccount | PUT /accounts/credit/{accountId} | Credits money to the given account |
AccountCommandController | debitMoneyFromAccount | PUT /accounts/debit/{accountId} | Debits money from the given account |
Class | Method | HTTP request | Description |
---|---|---|---|
AccountQueryController | findById | GET /accounts/{accountId} | Retrieves a single account by the given id |
AccountQueryController | listEventsForAccount | GET /accounts/{accountId}/events | Retrieves all events for the given account |
In order to connect to the H2 database using DBeaver, IntelliJ IDEA, etc. the following url can be used after running the application:
jdbc:h2:tcp://localhost:9092/mem:bank_account_db
After starting the application container on Docker, Axon Server UI will be reachable on http://localhost:8024/.
Click on Commands menu to list the executed commands:
Then, in order to list the queries, click on Queries menu:
We can see all the events in the Search section. Click on Search button on the Search section to grab all events:
Unit Tests are provided in the corresponding package(s).