Files
event-sourcing-examples/handy-curl-commands.sh
Chris Richardson 2e31853ad2 Improved module name <functional-area>-<Command|Query>....
Standalone services now use the Event Store Server (many tests still use the embedded server)
2015-04-14 19:08:07 -07:00

37 lines
919 B
Bash

#! /bin/bash -e
# Create account 1
account1=$(curl -v --data '{"initialBalance" : 500}' -H "content-type: application/json" http://localhost:8080/accounts)
# {"accountId":"0000014ae4caf314-ae7453bbb71e0000"}
curl -v http://localhost:8081/accounts/0000014ae4caf314-ae7453bbb71e0000
# {"accountId":"0000014ae4caf314-ae7453bbb71e0000","balance":50000}
# Create account 2
account2=$(curl -v --data '{"initialBalance" : 300}' -H "content-type: application/json" http://localhost:8080/accounts)
# {"accountId":"0000014ae4cc8415-ae7453bbb71e0000"}
curl -v http://localhost:8081/accounts/0000014ae4cc8415-ae7453bbb71e0000
#
transfer=$(curl -v --data '{"amount" : 150, "fromAccountId" : "0000014ae4caf314-ae7453bbb71e0000", "toAccountId" : "0000014ae4cc8415-ae7453bbb71e0000"}' -H "content-type: application/json" http://localhost:8082/transfers)
# {"moneyTransferId":"0000014ae4cef030-ae7453bbb71e0000"}