Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brunolkatz/dt-tst
https://github.com/brunolkatz/dt-tst
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brunolkatz/dt-tst
- Owner: brunolkatz
- Created: 2021-08-02T16:59:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-11T20:00:30.000Z (over 3 years ago)
- Last Synced: 2024-04-06T20:23:24.470Z (10 months ago)
- Language: Go
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DT-TST
```
Go: 1.16.5
```Environment Variables
---------------------
Name | Description | Accept Values | Default |
-----|-----------|---------|--------------|
ENV_PORT | Define server port | ```9999``` | ```9090```Annotations
-----------
- How to use .tool-version: [Here](https://github.com/asdf-vm/asdf)
- Run docker: ```docker-compose -f ./docker-compose.yml up -d```Determined tests Passed
-----------------------
- [x] Reset state before starting tests
- [x] Get balance for non-existing account
- [x] Create account with initial balance
- [x] Deposit into existing account
- [x] Get balance for existing account
- [x] Withdraw from non-existing account
- [x] Withdraw from existing account
- [x] Transfer from existing account
- [x] Transfer from non-existing account```text
--
# Reset state before starting testsPOST /reset
200 OK
--
# Get balance for non-existing accountGET /balance?account_id=1234
404 0
--
# Create account with initial balancePOST /event {"type":"deposit", "destination":"100", "amount":10}
201 {"destination": {"id":"100", "balance":10}}
--
# Deposit into existing accountPOST /event {"type":"deposit", "destination":"100", "amount":10}
201 {"destination": {"id":"100", "balance":20}}
--
# Get balance for existing accountGET /balance?account_id=100
200 20
--
# Withdraw from non-existing accountPOST /event {"type":"withdraw", "origin":"200", "amount":10}
404 0
--
# Withdraw from existing accountPOST /event {"type":"withdraw", "origin":"100", "amount":5}
201 {"origin": {"id":"100", "balance":15}}
--
# Transfer from existing accountPOST /event {"type":"transfer", "origin":"100", "amount":15, "destination":"300"}
201 {"origin": {"id":"100", "balance":0}, "destination": {"id":"300", "balance":15}}
--
# Transfer from non-existing accountPOST /event {"type":"transfer", "origin":"200", "amount":15, "destination":"300"}
404 0
```